Click to See Complete Forum and Search --> : using same function


thindery
02-23-2003, 04:35 PM
well here is the deal. i am going to have 50 different links. each link will open up a picture, they are all going to be the same size. i was going to use 50 different functions with these paramaters::

function my_win()
{
window.open('page.html','nameofwindow','width=125,height=150,toolbar=no,location=no,directories=no,s tatus=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');
}

then i thought, there had to be a more efficient way of doing it. i want to know if it was possible to have one function for 50 different links, if i just used a list of arrays. i tried it out, but it didn't work how i did it. maybe you guys could help me by just posting an example. if you could that would be very useful. thanks.


tylor

pyro
02-23-2003, 04:41 PM
Something like this, maybe?

function my_win(src,windowname)
{
window.open (''+src+'',''+windowname+'','width=125...');
}

and where you call your function, do it like this

my_win("yourpage.htm","yourwindowname")