AJAX application POST request for ASP.
Source:
A POST request for Ajax
function Submitinfo () {
$ (". Warn"). Hide (); Hide the wrong information when you just submit
var data = $ ("#formData"). Serialize (); Creates a URL-encoded text string by serializing the form's data through the serialized form values. A JQuery object that forms a collection of form elements
The $.post ("/login/checklogininfo", data, function (ajaxobj) {//) submits the data to the Checklogininfo method under the login controller. The parameter is data. If the request succeeds, the function is the callback function that executes when the request succeeds. Ajaxobj is the return data of the Checklogininfo method
Callback Content {Status:1 (Success)/0 (fail),}
if (Ajaxobj.status = = 0 | | status = = NULL) {//If the return status is 0 or null
$ (". Warn"). Show (); Display the error message
} else {
Landing success, jump to develop the page
window.location = '/hotellist/index ';
}
}, "JSON");
}
This article is from the "Buyaochitutu" blog, make sure to keep this source http://9885174.blog.51cto.com/9875174/1627234
AJAX application POST request for ASP.