Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > pass js var to Windows Media Player object param

Reply
Thread Tools

pass js var to Windows Media Player object param

 
 
fuzzylogic
Guest
Posts: n/a
 
      06-23-2006
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>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML::Template->param() : You gave me an odd number of parameters to param()! Dave Perl Misc 5 04-26-2011 02:44 AM
pass js variable to <object> parameter for Windows Media Player fuzzylogic Javascript 0 06-23-2006 07:09 PM
setting <param for media player plugin Tarren ASP .Net 0 11-02-2005 03:18 PM
Overload by deriv class param; call w base class param ectoplasm C++ 12 07-28-2005 08:20 AM
XSLT: How to replace param name with this param's value ? Geathaa XML 2 07-30-2003 06:48 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57