[Javascript] writing a param tag

Nick Fitzsimons nick at nickfitz.co.uk
Fri Apr 14 08:54:48 CDT 2006


Schalk wrote:
> Greetings All,
> 
> Would the code below be the correct way to create a param tag with the 
> name of movie and value of media/swf/header_wsound.swf ?
> 
> var flash_param = document.createElement('param');
>      flash_param.name = "movie";
>    flash_param.value = "media/swf/header_wsound.swf";
>      object_container.appendChild(flash_param);
> 
> Thanks!
> 

According to the W3C DOM secification for the HTMLParam element, that 
should work:
<http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-64077273>

If you have problems, try changing (for example)

    flash_param.name = "movie";

to

    flash_param.setAttribute("name", "movie");

but the way you have it should, in principle, work.

HTH,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/





More information about the Javascript mailing list