2 ms·
Basically it defers to a javascript function instead of using the web's normal way of linking. An example of such a link would be: <a href="javascript:void
by ChrisSD 9y ago
Basically it defers to a javascript function instead of using the web's normal way of linking. An example of such a link would be:
<a href="javascript:void(0)" onclick="dostuff()">Click me</a>
href="javascript:void(0)" basically tells the browser to do nothing when a link is clicked. It's like returning false from an event listener.
onclick="dostuff()" will then listen for clicks and call the `dostuff` function to update the page or load a new one.
Nowadays it's considered bad practice and to be honest it wasn't exactly good practice in those days but it was very commonly used.