• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2600
  • Last Modified:

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.
0
ou81aswell
Asked:
ou81aswell
  • 5
  • 2
1 Solution
 
Jackie ManCommented:
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.
0
 
Jackie ManCommented:
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".
0
 
ou81aswellAuthor Commented:
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>
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Jackie ManCommented:
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
0
 
Jackie ManCommented:
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

0
 
Jackie ManCommented:
In short, IE9 behaves correctly according to the declared doc type while IE8 does not.
0
 
ou81aswellAuthor Commented:
Understood. Thanks!
0
 
Michel PlungjanIT ExpertCommented:
That is so insane. Thanks for the heads up
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now