简体   繁体   中英

window.open is not working in IE8

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.

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.com", "google");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM