Hacker News new | past | comments | ask | show | jobs | submit login

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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: