...

View Full Version : Multiple Popups



a4udi
03-26-2005, 04:38 AM
Here's what I'm trying to do:

I've got 14 icons, and each links to a javascript window with an html page in it.

I can't figure out how to get each popup window to have seperate content in it though.

Here's my code so far, I've tried to setup 2 popups to seperate pages:


var a;
function popup()
{
a=window.open("samples/sample01.html","sample01","location=0,menubar=0,height=420,width=540,scrollbars=0,status=0,resizable=0,toolbar=0,directories=0");
}
var b;
function popup()
{

b=window.open("samples/sample02.html","sample02","location=0,menubar=0,height=420,width=540,scrollbars=0,status=0,resizable=0,toolbar=0,directories=0");
}

When I click the links on my page, both icons go to the same file sample02.html (so obviously i'm doing something wrong).

My links from the html are simply: (so that should be fine I think)

<a href="samples/sample01.html" onclick="javascript:popup();return false;">
<a href="samples/sample02.html" onclick="javascript:popup();return false;">

vwphillips
03-26-2005, 11:37 AM
your 2 functions must have unique names as only the last one is being called at the moment

and see
http://www.vicsjavascripts.org.uk/PopUpGenerator/PopUpGenerator.htm

Willy Duitt
03-26-2005, 06:59 PM
function popup(URL)
{
a=window.open(URL,"sample","location=0,menubar=0,height=420,width=540,scrollbars=0,status=0,resizable=0,toolbar=0,directories=0");
}




<a href="samples/sample01.html" onclick="popup(this.href);return false;">
<a href="samples/sample02.html" onclick="popup(this.href);return false;">


.....Willy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum