Prevent blank links (having javascript:;) from openening in new tab/window on middle click...?

Posted by jayarjo on Stack Overflow See other posts from Stack Overflow or by jayarjo
Published on 2010-06-08T09:46:15Z Indexed on 2010/06/08 9:52 UTC
Read the original article Hit count: 178

Filed under:
|
|
|

There is a common practice of using <a></a> tags to markup beautiful buttons, with onlick and onhover style change, etc. Which looks and behaves great, on most part.

Although there turned out to be a HUGE problem, which was not very obvious on start. The problem is that these beautiful "buttons" open new windows on middle click, either blank or with the same content as current one (depends on whether one uses # or javascript:; to disable href part).

Now I've got JavaScript RIA with buttons all over it, opening new windows on middle click... Lame...

At first I even couldn't understand why I get sometimes those blank pages in the browser.

Since it's pretty established practice to use links in such manner, maybe there is any established way to deal with described problem?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html