Good Day!
I came across an interesting issue while coding an extension I've been fiddling with for a while-- showing/hiding a specific button based on an 'if statement' inside a jQuery get() function. Since the function takes longer than the buttons and other elements to load, when calling a variable defined by the jQuery get() results to determine the button display (block or none), it returns undefined. Several solutions I have thought of are a possible setTimeout() to grab the value after an x amount of seconds, but this approach is not viable since the display should be dependent on the completion (success or failure) of the get statement, similar to an onload is to the html body.
Any Ideas?