I am trying to write a small routine that will open several pages. I have ‘copied’ the code from ‘Learn javascript in 21 days’, at least I think I have copied it, but cannot get it to work. I have tried to simplify it to get started but I do not appear to be calling the routine.
I’d be grateful if someone could show me where I have gone wrong.
TIA
Code is below.
<html>
<head>
<title>MTL Pages</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<script language=”javascript” type=”text/javascript”>
<!–
function OpenIt(currentform)
{
var pfx=”http://”
var tgt=”_blank”
var nameArray = new Array();
var urlArray = new Array();
nameArray[0] = “sabs”;
urlArray[0] = “www.ntlworld.com”;
nameArray[1] = “csa”;
urlArray[1] = “www.grc.com”;
nameArray[2] = “nexus”;
urlArray[2] = “www.bbc.co.uk”;
for (var i=0; i<nameArray.Length; i++) {
/* window.open(pfx + urlArray[i], nameArray[i], target = nameArray[i]);
window.open(“
alert(“Open It”);
}
}
//–>
</script>
</head>
<body bgcolor=”#FFFFFF” text=”#000000″>
<form name=”form1″>
<p><input type=”button” name=”OpenWin” value=”Open”
onclick=”OpenIt(this.form)”></p>
</form>
</body>
</html>