pass js var to Windows Media Player object param

F

fuzzylogic

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/ controls/mplayer/en/nsmp2i..."

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


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


</object>
</body>
</html>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top