Friday, December 01, 2006

javascript in href

There are two ways to use javascript in a href tag, e. g.,

1. <a href="javascript:doSomething()">...</a>
2. <a href="#" onclick="doSomething(); return false">...</a>


When using Microsoft HTA, however, only the second approach works. The first one will pop up a new window when the link is clicked, even under IE7.

No comments: