Standards Compliant “New Window” Link

First of all, I should mention I am heavily opposed to fairly recent trend of sites opening a new browser window when linking to another site. If I want to open the link in another window, I’ll open it in another window.

With my rant out of the way, sometimes it is absolutely essential that you be able to open a new browser window (i.e. enlarged images, links to other sites (when you specify the link will open a new window)), in which case the latest w3C strict specifications do have the Target attribute for the A tag. You could use a transitional language, but these are “dying” specifications, or you could implement a standards compliant “new window” link using java script.

This helpful article shows you exactly how to implement the script in your HTML pages. It is very simple to do and you can easily apply it to your existing pages. If the only thing keeping you from moving to a “Strict” W3C specification is the target attribute, then your problem is solved.

Free eBook!

Like what you read?

If so, please join over 28,000 people who receive our exclusive weekly newsletter and computer tips, and get FREE COPIES of 5 eBooks we created, as our gift to you for subscribing. Just enter your name and email below:

Post A Comment Using Facebook

What’s Your Preference?

Daily Alerts

Each day we send out a quick email to thousands of PCMECH readers to notify them of new posts. This email is just a short, plain email with titles and links to our latest posts. You can unsubscribe from this service at any time.

You can subscribe to it by leaving your email address in the following field and confirming your subscription when you get an email asking you to do so.

Enter your email address for
Daily Updates:

Weekly Newsletter

Running for over 6 years, the PCMECH weekly newsletter helps you keep tabs on the world of tech. Each issue includes news bits, an article, an exclusive rant as well as a download of the week. This newsletter is subscribed to by over 28,000 readers (many who also subscribe to the other option) - come join the community!

To subscribe to this weekly newsletter simply add your email address to the following field and then follow the confirmation prompts. You will be able to unsubscribe at any time.

Enter your email address for
Free Weekly Newsletter: