Hi philip! Thanks a billion for the reply.
I definitely agree with all of your points. When at all possible, I put all applicable JS in head or right b4 closing body tag. In this case, I wish I was using a CMS that could put the embedSWF in the <head>. I will start thinking of ways to put embedSWF code in the head... Thanks, Micky On Mar 6, 5:34 pm, Philip Hutchison <[email protected]> wrote: > the swfobject embedSWF call should be in the <head> of your document. > > <head> > <script src="Call to swfobject js"></script> > <script> > swfobject.embedSWF( "targetDiv" ... ) > </script> > </head> > > <body> > <div id="targetDiv"></div> > </body> > > many people placed swfobject 1.x calls in the body of the document. because > of its architecture, it made sense to use it inline on some occasions. > > however, swfobject 2.x is a complete re-write, and uses a domready/onload > event to load the SWF(s). this means placing the script in your body's > markup will have no positive impact at all... no matter where you place the > script, embedSWF will always execute after the entire DOM has loaded. > knowing this, and understanding that inline scripts are generally viewed as > a bad practice (with the exception of placing scripts just before the > </body> tag), we always recommend people place their embedSWF calls in the > <head> of the document. > > - philip > > On Fri, Mar 6, 2009 at 2:05 PM, Micky Hulse <[email protected]> wrote: > > > Hi, > > > I have one last question for the pro SWFobject users of this list... > > > Pseudo example code: > > > <head> > > <script src="Call to swfobject js"></script> > > </head> > > <body> > > <script> > > swfObject setup/embed with a div target of "targetDiv" > > </script> > > <div id="targetDiv"></div> > > </body> > > > In the above scenario, should the target div be above or below the > > swfObject setup script? > > > I am sure both will work, but what is optimal? > > > I assume having the div com first, and then the swfObject setup > > second? > > > Many many thanks for the clarification. :) > > > This list has been a life saver. > > > Cheers, > > Micky > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/swfobject?hl=en -~----------~----~----~----~------~----~------~--~---
