javascript : void(0)

You see "javascript:void(0)" all over the place, especially as the href value for a link that uses the onclick event for functionality.  Ever wondered exactly what this line of javascript does? 

According to the MSDN JScript 8.0 Reference,

"The void operator evaluates its expression, and returns undefined. It is most useful in situations where you want an expression evaluated but do not want the results visible to the remainder of the script."

As an added bonus, here are some more client-side references (from w3schools):

HTML 4.01 Entities Reference
HTML URL-encoding Reference

posted on Friday, September 29, 2006 8:09 PM by snyholm

Comments

# re: javascript : void(0)

i have poblom on orkut
i can not scap or add another person in my list

so [;z
help me
Sunday, April 27, 2008 6:35 AM by surdip