I am trying to open new window without toolbars using the code below but it opens new window with the toolbars (at least in IE). Any idea what am I doing wrong?
<a href="http://www.google.com" onclick="popupWindow(this.href)" target="_blank"><img src="/myImage"/><a>
function popupWindow(url)
{
window.open(url,"MyWindow","config='toolbar=no, menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no'");
}
A quick Google search found the syntax for this at DevShed:
<script language="javascript">
function myPopup(url, windowname, w, h, x, y)
{
window.open(url, windowname, "resizable=no, toolbar=no, scrollbars=no, menubar=no, status=no, directories=no, width=" + w + ", height=" + h + ", left=" + x + ", top=" + y);
}
</script>
Note that it differs from your own in that you have config=
as part of the last argument, and it's not needed (as AlienWebguy pointed out).
Thanks to everyone for replying.
The issues mentioned were typos here, they were correct on my original code.
For some reason in IE the name of the window has to be an empty string. So, if I rename "MyWindow" to "" it works. Strange but googling shows more people have this problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With