Results 1 to 3 of 3

Thread: Passing value ... confuse ! help me :(

  1. #1
    Join Date
    Nov 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Passing value ... confuse ! help me :(

    I'm trying pass value into value properties of <param> of <object> tag by javascript.

    Following is HTML code:
    <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="WindowsMediaPlayer1">
    <param name="FileName" value="" /> <!--Need pass value-->
    </object>
    <form>
    <input type="button" name="but" id="but" value="Song" onClick="test()" /> </form>

    ...and js code as below:

    <script type="text/javascript">
    function test() {
    var b = document.getElementById("WindowsMediaPlayer1").FileName.value;
    b = "bendoihiuquanh.mp3"; //I want b reference to value of <param>
    }
    </script>

    I don't know what i must do now? help me !

    (My player will play a song when I choose...otherwise, it doesn't work)

  2. #2
    Join Date
    Nov 2006
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok.

    you might try using the DOM ( getElementById() / getElementByTagName('param') )

    to access those values too.
    Giving each param an id=" "

  3. #3
    Join Date
    Nov 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried as you said :

    function test() {
    var b = document.getElementById("File").value;
    b = "bendoihiuquanh.mp3";
    }

    <body>
    <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="WindowsMediaPlayer1">
    <param id="File" name="FileName" value=""/>
    </object>
    <p>
    <form>
    <input type="button" name="but" id="but" value="Click to play" onClick="test()" />
    </form>
    </p>
    ...but WMP still not run !

    (Moreover, I thought function need return a value to reference to value properties of <param> and I tried but incorrect... )

    help me !

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •