skip to main | skip to sidebar
The Unbearable Lightness of Bit

Open in new windows with HTML 4.01 Strict

As every web-programmer should know, in HTML 4.01 strict the "target" property of the tags is no longer allowed. I would like to personally thank the WWW consortium for this, because I hate links that automatically open in a new window (while my best friend Firefox helps me keeping them in new tabs instead of new windows). However, under certain circumstances (?) may be desiderable to disturb the user by forcing the browser not to change the address of the current page (i.e. you don't want users to go away from your page); strange but true, you don't care about breaking the user's browsing history, but you would feel as a profanation to break the W3C standards. Here comes to help Javascript: just replace every

<a href="http://..." target="_blank">


with

<a href="http://..." onclick="window.open(this.href); return false;">


Welcome to the dark side of standard compliance!

Conceived on Monday, April 28, 2008 26 reactions

Newer Posts Older Posts Home
Subscribe to: Posts (Atom)
«All I want is a warm bed and a kind word and unlimited power»
Ashleigh Brilliant

Sections

  • About (2)
  • Bash (5)
  • Hacks (4)
  • HTML/CSS (4)
  • Humour (6)
  • Software (2)
  • Various (3)

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments
Software Blogs - Blog Catalog Blog Directory

Interesting feeds

If it was useful...

Small help?It's OK! Thanks!

Listening...

Archive

  • ►  2011 (1)
    • July (1)
  • ►  2010 (3)
    • September (1)
    • May (2)
  • ▼  2008 (9)
    • October (2)
    • July (2)
    • April (1)
    • January (4)
  • ►  2007 (14)
    • December (1)
    • November (2)
    • October (2)
    • July (3)
    • June (3)
    • May (3)
 

Creative Commons License
This website and all its content is published under a Creative Commons License.