Guest_imported
New member
- Jan 1, 1970
- 0
I am a newbie at javascript and was trying to make a page,that when loaded, opened a txt file, read it into an array, and open 3 random windows with the urls given in the lines of the txt file. This is the code I have. WHATS WRONG!! It's probably obvious to some, but i'm more of a asp(not a lang.),php,vb prog. not JAVA!
<html>
<head>
<script language="javascript1.2">
<!--
function win_open(){
win = new File("list.txt"
win.open("r"
var length = win.length
var spice=new array(length)
for (var i = 1; i <= length ; i++) {
spice = win.readln(i)
}
for(var i=1;i<=3;i++){
var rn=math.random(length)
window.open(spice[rn],"fullscreen,scrollbars=no"
;
}
win.close
}
//-->
</script>
</head>
<body onload=win_open()>
</body>
</html>
<html>
<head>
<script language="javascript1.2">
<!--
function win_open(){
win = new File("list.txt"
win.open("r"
var length = win.length
var spice=new array(length)
for (var i = 1; i <= length ; i++) {
spice = win.readln(i)
}
for(var i=1;i<=3;i++){
var rn=math.random(length)
window.open(spice[rn],"fullscreen,scrollbars=no"
}
win.close
}
//-->
</script>
</head>
<body onload=win_open()>
</body>
</html>