View Full Version : Javascript Po pup Help

02-14-2007, 06:13 PM
i need help with a javascript pop up...i have made this code:

<script type="text/javascript">
var newwindow;
function poptastic(url)
if (window.focus) {newwindow.focus()}
var newwindow2;
function mp3pop(url)
if (window.focus) {newwindow2.focus()}

i launch the popup with this:
<a href="javascript:poptastic('../linkus.php');"....
and the second:
<a href="javascript:mp3pop('../mp3pop.php');".....

the second block in red is a second pop up i want to make. this all works fine, but is there a way i can make the height and width a variable inside of the link so i can just use one re-usable code block? thanks anyone who helps :D.

02-14-2007, 06:42 PM
function mp3pop(url, height, width)
if (window.focus) {newwindow2.focus()}

02-14-2007, 06:48 PM
oh, thanks buddy. i thought of making the stuff in the url thingy but never figured it out. and could you explain what you did? it works, i just want to know why. thanks!