I’ve two php-scripts: the first makes ajax call to the second, which returns javascript code and div for swfobject. I’m calling the second file twice: after loading page(it works ok and I can see swfobjects) and after users’ clicking on button(it not works and div just goes blank).
I suggest that embedSWF works ONLY after pages’ loading, because my ajax calling is correct.
But a way must be found! Any ideas?
I’ve two php-scripts: the first makes ajax call to the second, which returns javascript
Share
Yes,
swfobject.embedSWFis designed to work after page load — it has a built-in domload event handler.If you don’t want swfobject to automatically embed when the page is loaded, use
swfobject.createSWFinstead. The official documentation explains howswfobject.createSWFworks.EDIT:
After re-reading your post, I see you want to embed a SWF after the page has already loaded.
swfobject.embedSWFcan be used in both cases. Here’s a tutorial and an example.