document - Where put SWFObject in JQuery -
I have 2 javascript in my head section, now I want to place the embedSWF function inside the first script. Only I can not believe ou ..
You want to take all the scripts better than head
There are & lt; / Body & gt; Above
, at the bottom of the page. This will make page load better, because loading javascript will block concurrent loading of second page elements such as css
and image
, which is more important than JS code . swfobject is more secure to put it inside the jQuery DOM Ready block.
function outputstats (E) {if (! E. Success) {// warning ('no flash, optional content'); } Else {// Warning ('Flash embedded successfully'); }} Jquery (function ($) {// warning ('Dome Ready'); var Flashwares = {}; var Params = {} swfobject.embedSWF ("test.swf", "album-rap", "930", "530", "9.0.0", "JS / Express installs .swf", flashwares, params, faucets, outputstats);});
Will make sure to run swfobject
after loading all required DOMs. If you exclude it from the block, it may still have the possibility of running the required DOM element waiting for the page to load, which will give unexpected results.
Comments
Post a Comment