New-Window Links in a Standards-Compliant World
Friday, February 1st, 2008Much to the chagrin of Web designers everywhere, the HTML 4.0 Strict and XHTML 1.0 Strict recommendations of the W3C no longer include the target attribute of the tag. The Transitional versions of the specifications still include it, but by definition, these specs are on the way out.
Whatever your personal feelings on the practice, the most common application for this attribute — opening a link in a new browser window with target=”_blank” — is still useful on today’s Internet. So if the standards say we shouldn’t use it, how should we go about creating new-window links, while following the latest Web standards?
You can read the original articles from here: http://www.sitepoint.com/article/standards-compliant-world/
The Complete Script
Here is the complete script. Notice the last line, which assigns the externalLinks function to the window’s onload event handler. This triggers the function when the document has finished loading.
Popularity: 2% [?]