Carlos said:
I tried it quiting the browser every time and even emptying the cache
on both browsers.
My question is then how can I prevent the link to be activated when
javascript is active? The result I want is to have the javascript
function activated with onclick to load it's content when Javascript is
enabled but the actual href= link to work when it isn't.
false has to be returned from the *event handler* for that, as it was
suggested. In case like
<a href="somePage.html" onclick="doSomething(); return false;">Click
me</a>
the (intrinsic) event handler is whatever you have in quotes after
onclick=.
doSomething function may return false, true, nothing or the purpose of
this world - the system couldn't care lesser, the link will be still
followed.
At the same time if you assign a handler pragrammatically like:
document.links[22].onclick = doSomething;
and doSomething returns false it *will* prevent the navigation.
No, UA makers were not on drugs while making it (at least not in this
case

, only rather careless of usability.
In the first case you have inline handler right in the tag "onclick"
attribute. On parsing it becomes anonymous function, so say
onclick="doSomething();"
becomes
onclick = function() {
doSomething();
}
This way you can see that no matter what doSomething returns, the
anonymous function itself returns nothing (undefined) so the navigation
is not prevented.
onclick="doSomething(); return false;"
does what expected.
At the same time
linkObject.onclick = doSomething;
directly assign onclick to doSomething, so whatever return value of
doSomething - this is return value of the event handler.