We use javascript to load our Flash elements into Webpages – it just makes life so much easier. There’s many ways you can go about it, but one is to use inline Javascript to handle function calls to your document.write(); or innerHTML(); functions. Naturally, these functions scrape through our HTML and do their business, targeting and replacing elements with the embed/object code for our Flash movies.
You might call us slackers, or you might base it on our faulty understanding of the defer attribute (and this site will confirm it), but we thought that adding the defer attribute to our inline code thus;
<script type="text/javascript" defer>
addFlash('flashdiv');</script>
Would mean that the inline script wouldn’t be executed until the whole page is loaded. So you could effectively add the code anywhere in the page – say, the header – and it didn’t matter. Well, what works in Internet Explorer doesn’t always work in Firefox (et al.).
Read More…