PDA

View Full Version : JavaScript Help



308holes
March 14th, 2002, 03:03
Hello i have this script that i want to use for more then one pop up on one page but it only is setup for 1 now can some one help me get it so i can open as many popup with dif address ?


<script>
function openIT() {

theURL= "index.html"
wname ="CHROMELESSWIN"
W=400;
H=200;
windowCERRARa = "../img/close_a.gif"
windowCERRARd = "../img/close_d.gif"
windowCERRARo = "../img/close_o.gif"
windowNONEgrf = "../img/none.gif"
windowCLOCK = "../img/clock.gif"
windowREALtit = " Task title"
windowTIT = "<font face=verdana size=1> Window title</font>"
windowBORDERCOLOR = "#000000"
windowBORDERCOLORsel = "#999999"
windowTITBGCOLOR = "#0066CC"
windowTITBGCOLORsel = "#00BBFF"
openchromeless(theURL, wname, W, H, windowCERRARa, windowCERRARd, windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit , windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel)
}
</script>

<A HREF="java script:openIT();">Open</A>

Jan
March 14th, 2002, 03:34
May I ask why you would want more than one popup. You risk losing valuable visitors to your site if you spawn multiple popups. I would hit control alt del very quick smart.

Please think about it strongly before you go ahead with it. :cry2:

308holes
March 14th, 2002, 04:19
It not like the normal popup it for images the user click the link the and the image popus up in the popup but i can get it to open more then one filename or webpage

Aquatix
March 14th, 2002, 05:19
<html>
<head>

<script language=javascript>
function openwindow()
{
window.open("http://www.blah.com/")
window.open("http://www.blahblah.com/")
}
</script>

</head>
<body>
<form>
<input type=button value="Open Windows" onclick="openwindow()">
</form>
</body>
</html>

- Aquatix :)

meow
March 14th, 2002, 13:26
By removing the URL from the function and pass it on from the link instead.

Example:
function openIT(meow)
{
yadda = window.open(meow, "", "")
}


<a href="http://www.google.com" onclick="openIT(this.href);return false">open</a>

This way you also avoid feucking it up for ppl with javascript off. Javascript URLs are evil. :devious2: