/    Sign up×
Community /Pin to ProfileBookmark

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>>

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@deep_dhyaniSep 21.2005 — try this

<script Language="javascript" type="text/javascript">

var url="Movies/OpenIsraelHigh.wmv?resolution=1";

alert(url.substring(url.length-1,url.length));

</script>
Copy linkTweet thisAlerts:
@oistagoimpauthorSep 21.2005 — 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
Copy linkTweet thisAlerts:
@oistagoimpauthorSep 22.2005 — Can't anyone help me?
×

Success!

Help @oistagoimp spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...