Click to See Complete Forum and Search --> : popups


tinmanIII
08-08-2003, 08:37 PM
i am having trouble with my popups, i want two ( through buttons)on one page but i dont know how to get the 2 scripts to differentiate between themselves

<script>
function openpopup(){
var popurl="http://www.awebsite.com"
winpops=window.open(popurl,"","width=400,height=338,scrollbars,")
}
</script>

so with the a href javascript:openpopup

how could i use this and define 2 separate links?????
my trial and error has only resulted in interesting errors?

can anyone offer a way to do this?

havik
08-08-2003, 08:54 PM
You could use the same script, like so:

<script>
function openpopup(popurl){
winpops=window.open(popurl,"","width=400,height=338,scrollbars,")
}
</script>

</head>

<body>

<form name="form">

<input type="button" value="Open pop up" onclick="openpopup('http://www.awebsite.com')">

<input type="button" value="Open pop up 2" onclick="openpopup('http://www.google.ca')">

</form>




Havik

tinmanIII
08-08-2003, 09:19 PM
thanx , but on of the links is within another javascript, the pop-ups each work by themselves , just not two at a time, so looking at another option of distinguishing between them

havik
08-08-2003, 09:23 PM
In that case, if you could simply create another popup function then call that one:

function openpopup2(){
var popurl = "http://www.somewebsite.com";
winpops=window.open(popurl,"","width=400,height=338,scrollbars,")
}


Otherwise, post a link to the script or the script itself and we'll see what we can come up with.

Havik

tinmanIII
08-08-2003, 09:30 PM
:D
that works, I think i was trying to make this problem harder than it needed to be :o)
time for a break i think
thanx again

havik
08-09-2003, 03:24 PM
lol, no problem. :D

Havik