IsaacL
IsaacL

Reputation: 690

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!

Upvotes: 3

Views: 6209

Answers (1)

jackJoe
jackJoe

Reputation: 11148

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');
    }

Upvotes: 7

Related Questions