Quote:
Originally Posted by CobraHosts
javascript void(0) means that JavaScript is attempting to open a new web page.
|
Absolutely not....
void(0) means "do nothing".
It's usually used when an javascript action is run via the onclick property of the href, but it can be anything...
The onclick event is trigerred before the href, and if the returned result of the onclick is false, then the browser won't go to the href.
I use this in a directory, to count links visits without disrupting the "open in tab" middle-click features of modern browser.
The onclick sends an ajax call to record the click, and when the ajax call is finished, the href is followed.
Try to go to that page with firefox and the firebug extension, and when you hover the link, do a right click and select "inspect this", and you will see what the onclick do.
__________________
Listen to the ducky: "This is awesome!!!"
|