Hi, trying to do something really simple, launch a popup window.
This hardcoded version works fine:
<SCRIPT language="JavaScript">
function newWindow(){
window.open('index.php','myWindow','width=300,height=200,resizable=yes');
}
</SCRIPT>
<?php
echo "<a href='javascript:newWindow()' >Launch PopUp</a>";
?>
But thats not much good to me, what i really need is something like:
<SCRIPT language="JavaScript">
function newWindow(url){
window.open(url,'myWindow','width=300,height=200,resizable=yes');
}
</SCRIPT>
<?php
$myUrl = 'index.php';
echo "<a href='javascript:newWindow($myUrl)' >Launch PopUp</a>";
?>
But cannot get it working, i've tried "onClick" variations too, probably something really simple I've got wrong, any ideas?