ewlsh / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

callDomLoadFunctions() hangs when called after dom ready #684

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Use jQuery to listen for the dom ready event like so: 
$(document).ready(function() { ... });
2. Execute a JSONP call to a server that is setup to deliberately hang for 20 
seconds.
3. Execute code involving SWFObject so that it embeds a flash object on the 
page.

What is the expected output? What do you see instead?

The SWFObject library should immediately begin embedding the flash object on 
the page; however, the "onDomLoad" function (within "swfobject.js") prevents 
the execution of "callDomLoadFunctions" until the pending JSONP calls (executed 
in step #2) return a response or timeout.

What version of the product are you using? On what operating system?

This is happening when using SWFObject v2.2 on Mac OS X 10.8.5 using Chrome 
39.0.2171.95 (64-bit) and Firefox 34.0.

Further comments and attached patch:

I've noticed a couple of people who have a technically separate, but similar, 
problem:
https://code.google.com/p/swfobject/issues/detail?id=532

This separate issue can be solved the same way that my problem can be solved: 
simply expose the "callDomLoadFunctions" method by including it on the global 
"swfobject" variable.

My problem is encountered when using RequireJS to include the SWFObject 
library. If any JSONP calls are made and left hanging (for say 20 seconds), 
then the "onDomLoad" function (from "swfobject.js") prevents the execution of 
"callDomLoadFunctions" until those pending JSONP calls return a response or 
timeout.

My application relies on jQuery to first detect the dom ready event before 
executing code that involves SWFObject. Because of this, I (just like 
GeorgeC...@gmail.com) need the ability to forego the SWFObject library's delay 
in executing its functionality that waits for the dom ready event.

I've added the one line of code necessary to fix this in the attached file.

Additionally, I understand the desire to only introduce bug fixes in the next 
version, but this fix cannot potentially introduce new bugs, thus the stability 
for the next version is not in jeopardy if you so choose to include this.

Original issue reported on code.google.com by sakat...@gmail.com on 18 Dec 2014 at 6:54

Attachments: