Originally posted by Ian Spence:
you never called that function, so you never used it.
my way tells it what to open in the window, your's tells it to open a blank page
Ian, I found out! I completelly forgot.
So,
No1. I have this is the Header:
<script language="JavaScript">
function PopupWindow(win) {
PopupWin=window.open(win,"PopupWin","toolbar=no,directories=no,status=no,scrollbars=yes,menubar=no,width=425,height=500"); PopupWin.window.focus()
}
</script>
No.2: I have this in public_common.pl
<a href="javascript:PopupWindow('$vars_config{NonCGIURL}/hex_codes.html');"><img src="$vars_config{NonCGIURL}/$vars_style{ubbcode_hex}" border="0" align="center"/></a>
which is a link to a small hack I did called Hex Codes, with a style button in CP and works very well.
I want to do it your way and get rid of my code from the Header but using the code bellow I still get the browser window along with the small one. Can you have a look at this:
<a href="$vars_config{NonCGIURL}/hex_codes.html" target="hex_code" onClick="window.open('$vars_config{NonCGIURL}/hex_codes.html','hex_codes','width=450,height=500,scrollbars=yes')" ><img src="$vars_config{NonCGIURL}/$vars_style{ubbcode_hex}" border="0" align="center" /></a>
what is wrong with it? where do I insert the "return false" tag?
Thank you,
Felix