can someone please help me with this javascript:void(null)
I found it used in link buttons as follows
<a onclick="ProcessResponse()" href="javascript:void(null)" >Accept Data</a>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basically what happens is the
onclickthe functionProcessResponse()is called and thehrefis set tojavascript:void(null)to disable the default behaviour of the link.Most developers are simply used to writing this too:
Example:
Suppose we have this link in place:
Note that
hrefis set towww.google.combut when you actually click on that link, it would simply call theProcessResponse()function and won’t go towww.google.combecause thereturn falseput afterProcessResponse()disables the default behavior of the link that is going towww.google.com. Same is the case for the link you have posted.