当使用 jQuery 进行 AJAX 调用时,我暂时只想有一个弹出框(使用alert()
)向我显示响应文本。
$(document).ready(function() {
$(".jeobutton").mouseup(function() {
var $button = $(this);
$.ajax({ url: 'getdata.php',
data: // <parameters>
type: 'get',
dataType: 'json',
success: function(output) {
// do something
},
error: function(xhr) {
alert("<some error>");
console.error(xhr.responseText);
}
});
});
});
响应文本打印得很好。但是,alert()
找不到对话框。
请帮助这个可怜的菜鸟。