admin管理员组文章数量:1418687
Hi Javascript gurus, I have this Javascript code which is working fine on Firefox , but it is not working on IE 7. Any ideas why?
Here is the code
function TestWindow()
{
SimpleWindow('Default.aspx', 'Simple Test', 200, 200, 'yes')
}
function SimpleWindow(mypage,myname,w,h,scroll)
{
var win= null;
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no'
win=window.open(mypage,myname,settings)
if(parseInt(navigator.appVersion) >= 4)
{
win.window.focus();
}
}
Hi Javascript gurus, I have this Javascript code which is working fine on Firefox , but it is not working on IE 7. Any ideas why?
Here is the code
function TestWindow()
{
SimpleWindow('Default.aspx', 'Simple Test', 200, 200, 'yes')
}
function SimpleWindow(mypage,myname,w,h,scroll)
{
var win= null;
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no'
win=window.open(mypage,myname,settings)
if(parseInt(navigator.appVersion) >= 4)
{
win.window.focus();
}
}
Share
Improve this question
edited Jul 8, 2009 at 20:25
Ateş Göral
140k27 gold badges141 silver badges191 bronze badges
asked Jul 8, 2009 at 20:17
ShivaShiva
1,4092 gold badges16 silver badges32 bronze badges
4 Answers
Reset to default 5You may have realized that IE is giving the error "Invalid argument."
IE doesn't seem to like window names with spaces in them. Change 'Simple Test' to 'SimpleTest' etc.
For myname parameter use only a-zA-Z0-9 characters. IE doesn't like any other, especially whitespace characters.
Check popup blockers
Check for reserved words. Your parameter name "scroll" is probably messing up your code in IE.
本文标签: javascriptPopup window not opening on IE7Stack Overflow
版权声明:本文标题:javascript - Popup window not opening on IE7 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745295207a2652033.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论