/    Sign up×
Community /Pin to ProfileBookmark

Trouble with Javascript Redirection

I can’t figure out why the following code does not work. It’s supposed to open a certain frame if a user is using a browser version 3 or higher, but it doesn’t work. Can somebody show me a sample of some code that would do this, and actually work?

Thank you

<html>
<head>
<title>
Rescue Africa
</title>
</head>
<!– This doesn’t work at all. Why? See page 124 and 125 of HTML artistry–>
<script language=”JavaScript”>
var ver = navigator.appVersion;
document.write(‘<frameset frameborder=”0″ border=”0″ cols=”468, 424, 114,*“> ‘);
document.write(‘<frameset frameborder=”0″ border=”0″ rows=”232,30,253,*
“> ‘);
if (ver >= 3){
document.write(‘<frame name=”nav” src=”topFace2.html” scrolling=”no” marginwidth=”0″ /> ‘);
}
//This part of the script does not appear to be working. It’s opening topFace1.html instead of
//topFace2.html on IE 6.0
else{
document.write(‘<frame name=”nav” src=”topFace1.html” scrolling=”no” marginwidth=”0″ /> ‘);
}
document.write(‘<frame name=”subNav” src=”crisis.html” scrolling=”no” marginwidth=”0″ /> ‘);
document.write(‘<frame name=”bottom” src=”bottomFace.html” scrolling=”no” marginwidth=”0″ /> ‘);
document.write(‘<frame name=”blackRow” src=”black.html” scrolling=”no” marginwidth=”0″ /> ‘);
document.write(‘</frameset> ‘);
if (ver >= 3){
document.write(‘<frame name=”middle” src=”crisisTXT.html” scrolling=”no” marginwidth=”0″ /> ‘);
}
//This part of the script does not appear to be working. It’s opening crisisTXTOldB.html instead of
//crisisTXT.html on IE 6.0
else{
document.write(‘<frame name=”middle” src=”crisisTXTOldB.html” scrolling=”no” marginwidth=”0″ /> ‘);
}

document.write(‘<frame name=”right” src=”right.html” scrolling=”no” marginwidth=”0″ />’);
document.write(‘<frame name=”blackCol” src=”black.html” scrolling=”no” marginwidth=”0″ />’);
document.write(‘</frameset>’);
</script>

<noframes>
<body>
Your browser does not allow frames.
</body>
</noframes>

</html>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJun 08.2005 — Change this part:

var ver = parseFloat(navigator.appVersion);
×

Success!

Help @nathaliaMota 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.18,
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,
)...