user1644544
user1644544

Reputation: 41

HTML Target Attribute not working correctly in Internet Explorer

I have recently started learning HTML, and am trying to use the target attribute with links to control where they are opened, but it is not working correctly when I try in Internet Explorer 9.

Below is the code with the links:

<a href="http://www.apogeephoto.com" target="new">Apogee Photo</a>
<a href="http://www.outdoorphotographer.com" target="new">Outdoor Photographer</a>
<a href="http://www.dpmag.com" target="new">Digital Photo</a>
<a href="http://www.popphoto.com" target="new">Popular Photography and Imaging</a>

The target is set so that only one of the links should be open at a time in a window, while the original window remains open. Instead however each link is a bringing up a new window.

I have also tested this is Firefox, and Chrome. It works exactly as it should in both of those browsers, so I don't understand why its not working in Internet Explorer 9. I messed around with the settings for Internet Explorer, but nothing changed. I also have used a validator on the html file, and it found nothing wrong with the file.

If anyone else has experienced this problem, and could at least guide me in the right direction for fixing the problem I would greatly appreciate it.

Upvotes: 2

Views: 5420

Answers (1)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201738

In normal use, target="new" (where new is just a name, with no predefined meaning) first opens a new window or tab, but subsequent link clicks with the same attribute reuse that window or tab, on IE 9 as well as on other browsers. So the problem is apparently related to some special settings in your browser.

Microsoft’s document on target says: “Windows Internet Explorer 8 and later. When Protected Mode is enabled and a webpage contains an anchor link with a named target, Windows Internet Explorer opens the target of the link in a new window when the target has a different integrity level than the webpage containing the link.”

Upvotes: 1

Related Questions