Tuesday, May 12, 2009

[JavaScript] Re: Setting param attributes

> Setting param attributes
> Posted by: "Dermot" paikkos@googlemail.com dermotduke
> Date: Mon May 11, 2009 12:24 pm ((PDT))
>
> Hi,
>
> I am struggling to get IE to play a quicktime file.
>
> I have a small function that, once the page is loaded, sets the <param
> src> value to a file in the same directory. The function works with FF
> v3+ but I can only get IE to work if I specify the src statically
> (within the HTML) whereas I want to set the src dynamically.
>
> Is my javascript ok? Is there some trick I am missing with IE7 that
> might help me achieve this?
>
> I've created a snippet below. I can't really supply a quicktime file
> on the list :-/ Any help is much appreciated.
> Thanx,
> Dp.
>
>
>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>
> "http://www.w3.org/TR/html4/loose.dtd">
>
> <html>
>
>
>
> <head>
>
> <meta http-equiv="Content-type" content="text/html;charset=iso-8859-1" >
>
> <title>Test</title>
>
>
>
>
>
> <script type='text/javascript'>
>
>
>
> function init() {
>
> var file = 'k0010009-h.264.watermarked.mov';
>
> var MyParam = document.getElementById("quickTimeParam"); // Param fo IE.
>
> // alert(MyParam+' '+MyParam.id);
>
> MyParam.setAttribute('src', file);

I think what you've got is changing the parameter's *name* to
"k0010009-h.264.watermarked.mov".

Try this:

myParam.setAttribute('value', file);

or even

myParam.value = file;

cheers

jon.

>
> var MyEmbed = document.getElementById("quickTimeEmbed"); // Param fo Netscape
>
> MyEmbed.setAttribute('src', file);
>
> }
>
>
>
> </script>


--
This message has not been scanned for viruses.

Since I do not use a Microsoft operating
system or software, and use only plaintext
for email, there is little need for me to do so.


------------------------------------

Visit http://aiaiai.com for more groups to joinYahoo! Groups Links

<*> To reply to this message, go to:
http://groups.yahoo.com/group/JavaScript_Official/post?act=reply&messageNum=16672
Please do not reply to this message via email. More information here:
http://help.yahoo.com/help/us/groups/messages/messages-23.html

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/JavaScript_Official/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:JavaScript_Official-digest@yahoogroups.com
mailto:JavaScript_Official-fullfeatured@yahoogroups.com

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/JavaScript_Official/

<*> To unsubscribe from this group, send an email to:
JavaScript_Official-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

0 comments: