pass js variable to <object> parameter for Windows Media Player

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://videowm.boeing.com/stlcs/66757_smp4/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/nsmp2inf.cab#Version=5,1,52,701"
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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top