Using the javascript: keyword javascript: in the link is not recommended. I managed to find only one article on why this could be harmful:
a href = "javascript: void (0);" - avoid emptiness
But the general consensus shows that you should not use it because it can confuse browsers without javascript support, as some of these browsers can be parsed as an invalid link.
Instead, you must provide a link to a page working on the functionality that javascript will provide, or display a message about the site for which javascript works correctly. Follow the same link return false; from your event, for example:
<a href="noscript.html" onclick="doSomething(); return false;">I'm a link</a>
Or, conversely, use return false; or preventDefault() and returnValue in your javascript code:
element.onclick = function () { /* // return false is better for most situations (see bobince comment) if (event.preventDefault) event.preventDefault(); else event.returnValue = false; */ doSomething(); return false; }
Andy e
source share