简体   繁体   中英

JS/HTML: Opening a link in a new browser window in IE8

So I am trying to make a link that opens a full image version of the one I have in a small version in a new browser window, and I am using the following code (:

<a href="#" class ="postImageA" onClick="MyWindow=window.open('http://www.w3schools.com/html/tryit.asp?filename=tryhtml_video_html5_4','MyWindow','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=1024,height=768'); return false;">test for StackOverflow</a>

It works in all browsers, except in our favorite IE8. Any ideas on how to make it work?

You will have to make sure IE is set to open in new window.

Go to Tools > Internet Options > General. Click on the Settings button in the Tabs section. Set the value of "When a popup is encountered" to "Always open popups in a new window."

One other thing I had to do was right-click on the yellow banner at the top of the page that says, "To help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could access your computer. Click here for options..."

I right-clicked on it and chose: "Allow Blocked Content..."

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