pass js var to Windows Media Player object param

Discussion in 'Javascript' started by fuzzylogic, Jun 23, 2006.

  1. fuzzylogic

    fuzzylogic Guest

    I have a js function to derive the root of my file and append a folder
    name '/slides/' onto it:

    function rootpathstring () {
    var myPath = document.URL
    var rootpathend = new String (document.URL.lastIndexOf('\/'));

    var rootpath = new String (myPath.substr(0, rootpathend) +
    '/slides/');
    //window.alert ('rootpath = ' +rootpath);
    }


    I want to pass the value of the variable, rootpath, to the Base ULR
    value inside of the Windows Media Player object tag. Typically the
    BaseURL value is hardcoded as seen here:


    <param name="BaseURL"
    value="http://servername.com/folder/folder/slides/" ref
    valuetype="ref">


    I would like to do something like this instead:
    <param name="BaseURL" value=rootpath ref valuetype="ref">


    But the above script does not work. I don't know how to get the value
    to pass. I'm not even sure if it is possible to do this. Please forgive

    my ignorance on this. I know this is not the right approach. Is there a

    solution?


    Here is an abbreviated version of the htm file and object tag with just

    the one <param> I need:


    <html>
    <head>
    <script language="javascript1.2" type="text/javascript"
    src="rootpath.js"></script>
    </head>
    <body onLoad="rootpathstring();">


    <object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
    id="MediaPlayer1" width="320" height="285" hspace="0" codebase=
    "http://activex.microsoft.com/activex/%20%20controls/mplayer/en/nsmp2i..."

    standby="Loading Windows Media Player components..."
    type="application/x-oleobject">


    <param name="BaseURL" value=rootpath ref valuetype="ref">


    </object>
    </body>
    </html>
    fuzzylogic, Jun 23, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cyshao
    Replies:
    1
    Views:
    3,294
    Steve C. Orr [MVP, MCSD]
    Apr 12, 2005
  2. Tarren
    Replies:
    0
    Views:
    365
    Tarren
    Nov 2, 2005
  3. ary
    Replies:
    1
    Views:
    1,064
    =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=
    Nov 28, 2006
  4. Gabriele Murari

    WINDOWS MEDIA PLAYER OBJECT

    Gabriele Murari, Jun 26, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    490
    Gabriele Murari
    Jun 26, 2007
  5. fuzzylogic
    Replies:
    0
    Views:
    246
    fuzzylogic
    Jun 23, 2006
Loading...

Share This Page