最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - window.open is not working in IE8 - Stack Overflow

programmeradmin1浏览0评论

I am using IE8, to open a window i am using this code,

window.open(url,"STO");

Its working in other browsers except IE8.

please tell me what is the problem with IE8? I tried turningoff popupblocker also.

I am using IE8, to open a window i am using this code,

window.open(url,"STO");

Its working in other browsers except IE8.

please tell me what is the problem with IE8? I tried turningoff popupblocker also.

Share Improve this question edited May 16, 2012 at 11:56 ratchet freak 48.2k5 gold badges74 silver badges112 bronze badges asked May 16, 2012 at 11:52 user27user27 27410 silver badges27 bronze badges 1
  • What errors are you seeing in your JS console? – Marc Commented May 16, 2012 at 11:54
Add a ment  | 

4 Answers 4

Reset to default 2

FYI: I ran into this as well. I was generating a PDF and then using window.open(url,'_blank') to open the PDF in a new window. It worked fine in IE8 in Dev and Test but, in production, the window would just automatically open and then close. I searched the net\stackoverflow but did not find a solution that actually matched the problem.

It turned out that the link to the application on the client's intranet was via IP address instead of name. IE treats sites that addressed by IP as though they are in the internet zone even if they are actually on the intranet. I had the client's admin change the link and the pop up worked just fine.

I am sure there are security settings in the different zones governing this behavior but I would not want to make the Internet Zone settings less stringent.

I have tried with this code.And It worked perfectly for me .

var w =window.open(url,'_blank');
w.location.href = url;

if you are running the same code as you've shown here then let me tell you there is nothing wrong with the code. May be your pop up blocker is on try to turn it off and then try again. You can turn it off by Tools->Internet Options-> Pricacy(tab)-> Uncheck popup blocker option. Hope it helps

Please check your URL variable

try this

window.open("goole.", "google");
发布评论

评论列表(0)

  1. 暂无评论