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>