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,437 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
  • 5
  • 2
8 Comments
 
LVL 41

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 41

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
 
LVL 41

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 41

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 41

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now