admin管理员组文章数量:1334297
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!
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!
Share edited Oct 6, 2013 at 10:20 IsaacL asked Aug 1, 2011 at 16:41 IsaacLIsaacL 6904 gold badges13 silver badges25 bronze badges 10-
Why not just use
target="_blank"
? – ayyp Commented Aug 1, 2011 at 16:45 - I tried it on IE 9, but I'd like it to work on any of the current versions (I think XP still uses IE 8). And I need it to open in a popup window, not in a new tab. – IsaacL Commented Aug 1, 2011 at 16:47
-
Have you tried changing it from
"page.html","Title"
to'page.html','Title'
? – ayyp Commented Aug 1, 2011 at 16:50 - 1 This is a pretty dumb question, but is IE blocking the popup? – James Commented Aug 1, 2011 at 16:53
- Just tried that, didn't help. – IsaacL Commented Aug 1, 2011 at 16:53
1 Answer
Reset to default 7That'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./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./player.html','JewishMusicStream','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=660,height=620');
}
本文标签: htmlJavascript code to open a new window not working in IEStack Overflow
版权声明:本文标题:html - Javascript code to open a new window not working in IE - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742261262a2442555.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论