Solved

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

Posted on 2011-03-17
8
2,475 Views
Last Modified: 2012-06-27
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
Comment
Question by:ou81aswell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 44

Expert Comment

by:Jackie Man
ID: 35162441
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
 
LVL 44

Expert Comment

by:Jackie Man
ID: 35162475
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
 

Author Comment

by:ou81aswell
ID: 35162773
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
Independent Software Vendors: 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!

 
LVL 44

Expert Comment

by:Jackie Man
ID: 35163044
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
 
LVL 44

Expert Comment

by:Jackie Man
ID: 35163087
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
 
LVL 44

Accepted Solution

by:
Jackie Man earned 250 total points
ID: 35163099
In short, IE9 behaves correctly according to the declared doc type while IE8 does not.
0
 

Author Closing Comment

by:ou81aswell
ID: 35163137
Understood. Thanks!
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 35164023
That is so insane. Thanks for the heads up
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question