How to write the simplest AJAX program to submit a form
This article introduces the knowledge of "how to write the simplest AJAX program to submit a form". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The copy code is as follows:
Function tijiao () {
$("# tijiaoanniu") .val ("submitting...")
$.ajax ({
Type:'POST'
Url:'action.php?type=reg'
Data:$ ("form") .serialize (), / / serialize everything in the form
Success: function (data) {
Alert ("Registration successful!")
_ window.location='/member.php'
}
});
}
That's all for "how to write the simplest AJAX program to submit a form". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!