Shockwaves in Wordpress with jQuery Flash

The other day I had to figure out how to load a shockwave into a wordpress post, I decided to do it with jQuery jFlash. I always edit in HTML mode so I could just paste the following in my article:

<script type="text/javascript" src="http://www.prodevtips.com/jquery.flash.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $("#flash").flash({ 
    src: "http://www.prodevtips.com/wp-content/uploads/2008/08/tut.swf", 
    width: 700, 
    height: 500, 
  }); 
});
</script>
<div id="flash"></div>

Note the absolute URLs, I have no idea what relative path to use for this stuff in Wordpress. It’s safer and easier to just go with the whole thing. This works for me because I’ve already included the base jQuery script at the top of my page, you need too, check out the jQuery homepage for more info.

Also note the use of double quotes (). The example I copy pasted first was using single quotes () but Wordpress filters them out so only doubles are good here.



Related Posts

Tags: , , , ,