...

View Full Version : JavaScript Pop-Up Window Help



tomraffe
10-09-2003, 12:29 AM
I'm using the script for a JavaScript pop-up window from the following site, http://wsabstract.com/popwin/index.shtml
Trouble is, when I have the code several times on one page linking to different sites, they all display the same site when I click the link even through the target page is different.
In this case, all links show 'reviews3.html'
The whole code is below, I would appreciate your help.

http://www.evolved-games.com/litr2/reviews.html

<html>
<!-- Created with the CoffeeCup HTML Editor -->
<!-- http://www.coffeecup.com/ -->
<!-- Brewed on 01/02/2003 23:15:14 -->
<head>
<title></title>
<meta http-equiv="Page-Exit" content="blendTrans(Duration=1)">
</head>
<body bgcolor="#6979E8">

<p><center><font face="Verdana" size="1"><u>Reviews</u>
<p><script>
function openpopup(){
var popurl="reviews1.html"
winpops=window.open(popurl,"","width=400,height=338,scrollbars,menubar,")
}

</script>

<a href="javascript:openpopup()">Waxing Captors Reviews</a></b>
</script>
<p><script>
function openpopup(){
var popurl="reviews2.html"
winpops=window.open(popurl,"","width=400,height=338,scrollbars,menubar,")
}

</script>

<a href="javascript:openpopup()">Les Revoilou! Reviews</a></b>
</script>
<p><script>
function openpopup(){
var popurl="reviews3.html"
winpops=window.open(popurl,"","width=400,height=338,scrollbars,menubar,")
}

</script>

<a href="javascript:openpopup()">Live Revoilou! Reviews</a></b></script>
</font>
</body>
</html>

Kor
10-09-2003, 09:21 AM
It's wierd script.... there are 3 functions there with the same name... That is incorrect. You should either name them different, or use a single function and parse a parameter on event (with the variant of using directly this).

Try this:

in HEAD


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


now call the function in BODY



<a href="javascript:void(openpopup('reviews1.html');return true)">blabla1</a>
<a href="javascript:void(openpopup('reviews2.html');return true)">blabla2</a>
<a href="javascript:void(openpopup('reviews3.html');return true)">blabla3</a>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum