Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript code to open a new window not working in IE

I have some code on my site that's supposed to open a new window when a user clicks on the link.

Everything works correctly in Chrome and Firefox, but it won't work in IE.

Here's the code I have in the page header:

<script type="text/javascript">
function popopen()
{
    newwindow = window.open("page.html","Title",'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=660,height=620');
}
</script>

And this is the code on the link:

<a href="javascript: popopen()">Click to open the popup</a>

How can I get it to work correctly in IE?

Thanks!

like image 721
IsaacL Avatar asked Jun 03 '26 02:06

IsaacL


1 Answers

That's because the name of the window (JewishMusic Stream) has spaces! (other browsers allow it, but IE 6, 7 & 8 don't)

you have at line 151:

function popopen()
{
    newwindow = window.open('http://jewishmusicstream.com/player.html','JewishMusic Stream','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=660,height=620');
}

Should be:

function popopen()
    {
        newwindow = window.open('http://jewishmusicstream.com/player.html','JewishMusicStream','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=660,height=620');
    }
like image 96
jackJoe Avatar answered Jun 05 '26 16:06

jackJoe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!