pedromillers
pedromillers

Reputation: 237

IE8 a href for local files opens new window despite target="_Self"

My set of files are all on a local server, not http. If I use:

    <a href="somefile.htm" target="_Self">click here</a>

it opens the file in a new window. _Top is also ignored, and I get a new window. I can get around it by using window.open() but for various reasons we need to avoid javascript.

I'm interested to know why the a href target is ignored.

Upvotes: 1

Views: 436

Answers (1)

Explosion Pills
Explosion Pills

Reputation: 191739

You want to use _self (or just leave it off altogether): http://jsfiddle.net/rsmRA/ -- this is a case-sensitive value.

According to the spec, it doesn't seem like it's supposed to be case-sensitive, so I guess this is a browser bug. If you set it to anything except those keywords it is a "browsing-context name." You can see this in action by clicking that same link twice; you will notice that it only opens a new window the first time and reloads that window the second time.

Upvotes: 3

Related Questions