View Full Version : popup via link

02-10-2004, 12:47 AM
hey how do i popup a window when a user clicks a link? like how can i make a link open up in a new popup window. kinda like a popup ad where i can set the variables like size and stuff but it opens when they click a link? thanks so much...

02-10-2004, 03:04 AM
function pop(url, target){
var w = window.open(url, target, 'width=800,height=400,resizable=1');
return false;

<a href="page.htm" target="popup1" onclick="return pop(this.href, this.target)">Popup 1</a>
<a href="page2.htm" target="popup2" onclick="return pop(this.href, this.target)">Popup 2</a>

For more details of the window features, go here (http://www.devguru.com/Technologies/ecmascript/quickref/win_open.html).