Adding Param to Object in IE7 not working

45 views Asked by At

Honestly, I'm stumped, I haven't been able to find an answer yet.

I am trying to add a param to an existing object embed via javascript, and it works every where but IE7.
Here's my code:

<object type="application/x-shockwave-flash" data="player.swf" width="480" height="360" id="flashVideo">
      <param name="movie" value="http://player.longtailvideo.com/player.swf" />
      <param name="allowFullScreen" value="true" />
      <param name="wmode" value="transparent" />
</object>

and then the javascript:

<script type="text/javascript">
    var posterEncode = encodeURIComponent("images/poster.jpg");
    var fileEncode = encodeURIComponent("videos/myVideo");
    var myObject = document.getElementById("flashVideo");
    var param = document.createElement("param");
    param.setAttribute('name', 'flashVars');
    param.setAttribute('value', 'controlbar=over&amp;image='+posterEncode+'&amp;file='+fileEncode+'.mp4');
    myObject.appendChild(param);
</script>

What am I missing here?

0

There are 0 answers