javascript:; vs javascript:void(0);
问题 I would like to know what is the difference between javascript:; and javascript:void(0); if I use them in href attribure for a anchor (link) <a href="javascript:;" onclick="DoSomething();">Link</a> <a href="javascript:void(0);" onclick="DoSomething();">Link</a> I see them acting the same on all browsers but what is the technical difference? Regards, Magdy 回答1: One runs JavaScript that has no statements, the other runs JavaScript that evaluates the statement 0 and then returns undefined .