oistagoimp
09-21-2005, 08:53 PM
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>>
ok I have two pages
the first is Commercials.html ( http://www.yarivhorowitz.com/Commercials.htm )
and the second is CommercialNumberOne.html
When you click on the first link for the first commercial on CommercialNumberOne .html. I want CommercialNumberOne.html opened with the variable resolution 1 passed in the url. Then I want a link on CommercialNumberone.html (Hi/LO) if the link 'lo' is chosen then the page is reloaded and a '0' is passed in the url so the low resolution file is loaded in the javascript commands in the <object> tag. Thats where I need help
Edit/Delete Message
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>>
ok I have two pages
the first is Commercials.html ( http://www.yarivhorowitz.com/Commercials.htm )
and the second is CommercialNumberOne.html
When you click on the first link for the first commercial on CommercialNumberOne .html. I want CommercialNumberOne.html opened with the variable resolution 1 passed in the url. Then I want a link on CommercialNumberone.html (Hi/LO) if the link 'lo' is chosen then the page is reloaded and a '0' is passed in the url so the low resolution file is loaded in the javascript commands in the <object> tag. Thats where I need help
Edit/Delete Message