Wrong wording, mainly in the href= "#" here
Copy Code code as follows:
Wrong wording, mainly in the href= "#" here
The script is as follows
Copy Code code as follows:
if (data = = "Sent successfully") {
alert (data);
Window.location.href = window.location.href;
}
Correct writing href followed by a javascript:void (0) If it is IE6 it is best to add a return false after the onclick
1:
Copy Code code as follows:
<a href= "javascript:void (0);" id= "Send" onclick= "return ButtonClick ();" > Send </a>
2:
Copy Code code as follows:
<a href= "javascript:void (0);" id= "Send" onclick= "ButtonClick ()" > Send </a>
3: Recommend this type of writing, IE6 can perfect support
Copy Code code as follows:
<a href= "javascript:void (0);" id= "Send" onclick= "Javascript:buttonclick (); return false;" > Send </a>
The above 3 kinds of writing, as if all can be used, and there is no difference, when the ButtonClick function returned return false, it is the same to prevent the function to continue to run