我在这里有点偏离,需要一些帮助。以下适用于jquery 1.7及更低版本,但不适用于更高版本。有人可以引导我朝着正确的方向前进吗?
// -- Start AJAX Call --
$.ajax({
type: "POST",
url: "do-login.php", // Send the login info to this page
data: str,
success: function (msg) {
$("#status").ajaxComplete(function (event, request, settings) {
// Show 'Submit' Button
$('#submit').show();
// Hide Gif Spinning Rotator
$('#ajax_loading').hide();
if (msg == 'OK') {// LOGIN OK?
go_to_private_page();
} else { // ERROR?
var login_response = msg;
$('#login_response').html(login_response);
}
});
}
});
// -- End AJAX Call --
答案 0 :(得分:1)
试试这个:
$.ajax({
type: "POST",
url: "do-login.php", // Send the login info to this page
data: str
}).done(function (msg) {
// Do your thing here.
});
看一下JQuery文档:https://api.jquery.com/jQuery.ajax/