Copy Code code as follows:
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("#submit"). Click (function () {
$.post ("sendpwd.php", {qqnum:$ ("#QQnum"). Val (), psw:$ ("#psw"). Val ()},function (data) {
$ ("#aaa"). HTML (data);
}, "html");
});
});
</script>
The JQuery Ajax Post method should have no problem writing, click submit Submit button, sendpwd.php through $_post receive the value, then echo a piece of data. However, it is always impossible to display the returned value. The reason is here:
Copy Code code as follows:
<input type= "Submit" name= "Submit" id= "Submission" value= "submitted"/>
The type of submit button is submit, no response after clicking. Because there is no intention to find a moment to click the results came out, and then changed back, and found that strange, the Internet, found that most of the button set to the type, and then changed to button, the problem solved.
What's the difference between button buttons and submit?
Submit is mainly submitted form, is a special button, the implementation of the submission action, button mainly with JavaScript operation, itself is a button, this is the fundamental difference. If you want to use submit, the validation requires return false. I think it is more convenient to set the button to operate.