Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read File, Read into array, open randow win????

Status
Not open for further replies.

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=&quot;javascript1.2&quot;>
<!--
function win_open(){
win = new File(&quot;list.txt&quot;)
win.open(&quot;r&quot;)
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],&quot;fullscreen,scrollbars=no&quot;);
}
win.close
}
//-->
</script>
</head>
<body onload=win_open()>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top