I am fairly new at Javascript and I am having trouble integrating a Javascript variable in an HTML <object> tag.
I have created a web site of commercials that POSTs a 1 at the end of the url (?1) when a specific commercial is chosen.
On the page of the commercial I want it to check the integer of the substring in the url and if it is a one to load the higher resolution video and if not then to load the lower resolution. Here is my code:
//I PUT THIS IS AN OBJECT TAG FOR WINDOWS MEDIA PLAYER DIRECT X
<script language = “Javascript”>
if(location.search.substr(1).split(“?”))
{
<PARAM NAME = “FileName” VALUE = “Movies/OpenIsraelHigh.wmv”>
}
else
{
<PARAM NAME= “FileName” VALUE = “Movies/OpenIsrael.wmv”>
}
</script>
I also tried:
<script language = “Javascript”>
var FileName = null;
if(location.search.substr(1).split(“?”))
{
FileName = “Movies/OpenIsraelHigh.wmv”
}
else
{
FileName = “Movies/OpenIsrael.wmv”
}
</script>
<object tag=value
tag = value
<PARAM NAME = “FileName” VALUE = <script language=”Javascript”>FileName</script>>