jQuery problems in IE? It could be SWFObjects.
November 20th, 2008
Posted by scotti3g
So your jQuery/JavaScript code doesn’t have any errors, yet your site isn’t working as expected in Internet Explorer? It could be that you have some SWFObject code interfering with your jQuery code (if for example, you’re using a Flash video player or something along those lines). The solution is very simple. Simply enclose your SWFObject code in a jQuery $(document).ready() as so:
<script type="text/javascript"> $(document).ready(function(){ var so = new SWFObject("movie.swf", "mymovie", "400", "100%", "8", "#336699"); so.addParam("quality", "low"); so.addParam("wmode", "transparent"); so.addParam("salign", "t"); so.write("flashcontent"); }); </script>
The only downside to this is that if you have some alternate HTML to show when Flash isn’t present, this text will be shown until the document is fully loaded and the player(s) start to render (even if the user does in fact have Flash installed).
Thanks for the note. I may bump into the problem later with my own website. I plan to add some flash videos on my jQuery pages when I have time.
Hi Ming. Thanks for your comment. Hope the post helps save you some time :) Would love to hear what you and the other readers are working on.
Cheers,
Scott
Thanks for posting this. Was scratching my head there for a bit but this solved it!
keep up the great piece of work, I read few content on this site and I conceive that your website is rattling interesting and contains lots of excellent info .
Thanks.. helps me a lot.