1/17/2007

javascript:void

Sometimes, you may need to call some JavaSript from within a link. Normally, when you click a link, the browser loads a new page (or refreshes the same page).

This might not always be desirable. For example, you might only want to dynamically update a form field when the user clicks a link.

To prevent the load from refreshing, you use the JavaScript void() function and pass a parameter of 0 (zero).

No comments: