$.ajax({
type: "POST",
url: "some.php",
data: { name: "John", location: "Boston" }
})
.done(function( msg ) {
alert( "Success: " + msg );
})
.fail(function( jqXHR, textStatus ) {
alert( "Request failed: " + textStatus );
});
注意:在上面的代码示例中,我们使用了jQuery库来处理Ajax请求。确保你已经正确引用了该库或使用其他等效的库来处理Ajax请求。
上一篇:ajax提取h5缓存数据库
下一篇:Ajax提示成功信息已停止工作