Link to home
Start Free TrialLog in
Avatar of John
JohnFlag for Canada

asked on

IE9: Problem with links with target = _blank when link points to a page on the same domain

With IE9 i have noticed that any links that use target="_blank" and point to the same domain end up opening a new blank tab.

So if the page at www.mydomain.com/index.html contains a link to www.mydomain.com/anotherpage.html with target="_blank", clicking on it results in a new blank tab.

Links to other domains that use target="_blank" work as expected. That is, they open up in a new browser window.

What is the simplest change I can make to make this work as expected across all of the popular browsers? This wasn't a problem with IE8.

I'm running Win 7x64 and of course, IE9.
Avatar of Jackie Man
Jackie Man
Flag of Hong Kong image

In IE9, goto Tools > internet Options > General > Tabs [Settings] > select "Always open pop-ups in a new window" instead of "let internet explorer decide how pop-ups should open".

Restart IE9 to test the results.
Please give the URL of your website for us to check your HTML code if you want to set the default option to "let internet explorer decide how pop-ups should open" instead of "Always open pop-ups in a new window".
Avatar of John

ASKER

Thanks guys.

Here's an example page. Click on the "Online Forum" link. It's where it says

There are three types of support available:
-Online Forum
-Email: support
-Phone: (613) 569-4675 x 175

Here's the link.

http://www.informationactive.com/iacrm.cgi?x=show&j=147

With IE9 this opens a blank (white) tab.

The actual code for the link is

<li><a target="_blank" href="/forums">Online Forum</a></li>
You need to use JavaScript to open new window instead of HTML code because you declare the page to be XHTML 1.0 strict.

Details are as follows:

"In terms of Strict vs Transitional, the Transitional doctype won't punish you for omitting certain details or including deprecated attributes/tags. For example, the following is valid XHTML 1.0 Transitional, but not XHTML 1.0 Strict:

<a target="_blank" href="#">I open a new window</a>
Why? The target attribute is considered deprecated now, it is only present in the Transitional and Frameset doctype. This is probably one of the two big gripes people have with XHTML 1.0 Strict, you must use JavaScript to open new windows, but that makes sense to some degree. Much like you no longer use width, height, or valign in tables in favor of CSS, you no longer use target in links in favor of JS. Another big gotcha of Strict is that every img tag must contain an alt attribute, this is not true in Transitional.

That's all pretty straightforward and objective, though. Those are the big differences between the doctypes--which you choose to use is purely subjective: I personally use Strict in most of my documents because I don't see a reason not to use it."

Source: http://doctype.com/doctype-validation
Try to change the declaration header to the code below.

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jackie Man
Jackie Man
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of John

ASKER

Understood. Thanks!
That is so insane. Thanks for the heads up