Frontendplace Blog

Sharing Frontend developing ideas

onUnload fires when using void(0) in anchor

Posted by info on August 23rd, 2010

When you use an onclick handler on an anchor that does not return false and you use javascript:void(0) as a href be warned that the onunload will be fired. If you remove eventhandlers on the onunload to prevent memoryleaks then your eventhandlers will be removed when clicked on that anchor.