javascript:void(0) is an error message that occasionally appears in a web browser when there is a problem loading a JavaScript from a webpage.

Possible causes (and solutions) for the javascript:void(0) error message include:

Problem Possible Resolution(s)
A popup blocker blocking the JavaScript Disable the popup blocker
A malfunctioning web proxy Disable the web proxy if possible
An improperly written JavaScript Webmaster must rewrite the JavaScript
JavaScript is not enabled Enable JavaScript
Web browser JavaScript implementation is broken Switch or upgrade the web browser

Programming with javascript:void(0)

javascript:void(0) is used with the href attribute of the HTML <a> tag. Usually, clicking on a hyperlink reloads or redirects to another webpage. This may not be feasible every time. Many times, clicking a hyperlink requires performing some client side script operation instead of reloading or redirecting. This can be achieved by placing “javascript:void(0)” in the tag’s href attribute.

Example

<a href="JavaScript:void(0);"ondblclick="alert('Good example!')">Example</a>