Click to See Complete Forum and Search --> : Plz Help with links script


Jupac
07-25-2003, 06:56 PM
Hi this i will put in to a .js file so i can use it on every page but it dosnt work so plz can you tell me wat i am doing wrong

<script>
function on(url){
var id = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
var url= new Array("a,http://www.w3c.org","b,http://www.aol.com")
for (i=0;i<=id.length;i++) {
if (id == url[i]) { window.open("url+","name",config="height=310,width=450,resizable=1,scrollbars=1,status=0,top=0,left=0,screenx=0,screeny=0,toolbar=1,me nubar=0,location=1")}

}
</script>

<table>
<div><b><a href="#" onclick=on(a)>Open W3c</a></b></div>
<div><b><a href="#" onclick=on(b)>Open Aol</a></b></div>
</table>

Yogg
07-25-2003, 08:33 PM
Here, your script, when you click on a link, wants to open 26 windows and finds just 2 urls so 2 windows will find a page and others will be empty... That's what you want to do ?

And you shouldn't use url as the name of the argument, and then create a new array named url. After this you don't see the first arg anymore.

Jupac
07-25-2003, 10:06 PM
I get what you mean but i still cant get it to work

<script>
function on(url){
var id = new Array("a","b")
var url1= new Array("a,http://www.w3c.org","b,http://www.aol.com")

if (id == url1) { window.open("url+","name",config="height=310,width=450,resizable=0,scrollbars=0,status=0,top=0,left=0,screenx=0,screeny=0,toolbar=0,me nubar=0,location=0")}

}
</script>

<table>
<div><b><a href="#" onclick=on(a)>Open W3c</a></b></div>
<div><b><a href="#" onclick=on(b)>Open Aol</a></b></div>
</table>