Appending void(0)
to javascript instructions is a common trick when you use a javascript:
pseudo-URL to run code. If you omit doing this, and the script returns something other than undefined, it will be treated as if it was passed to document.write
- that is, the browser will navigate away to an empty page.
There are valid applications for this trick (namely, bookmarklets should always end like this), but in the example you gave it is just wrong, for reasons already explained by others.