Ajax Get Request with JQuery Error
Ajax Get Request with JQuery Error
我试图用get请求调用一个php脚本,并使用数据地址,但结果显示了我调用的页面的来源。
我呼叫的页面在这里这是我的ajax函数,它将获得这个页面
$( document ).ready(function() {
var address = document.getElementById("address");
$.ajax({
url: '/r10database/checkSystem/ManorWPG.php',
type: 'GET',
data: 'theaddress='+address.value,
cache: false,
success: function(output)
{
alert('success, server says '+output);
}, error: function()
{
alert('Something went wrong, saving system failed');
}
});
});
$( document ).ready(function() {
var address = document.getElementById("address");
$.ajax({
url: '/r10database/checkSystem/ManorWPG.php',
type: 'GET',
data: 'theaddress='+address.value,
cache: false,
success: function(output)
{
alert('success, server says '+output);
}, error: function(error)
{
alert (error); // this is the change from the question
}
});
});
将dataType设置为带大括号的json
data: {theaddress:address.value},
dataType:'json',
success: function(output)
{
alert('success, server says '+output);
}, error: function(xhr)
{
alert (xhr.status);
}
并将ManorWPG.php中的数据获取为$_get['headdress']
**如果失败,则共享xhr.status。
相关文章:
- jQuery Error adadvisor.net
- Jquery Animate on IE makes error
- jquery ajax delete 404 error
- JQuery Error在出现错误时加载备用映像的事件
- jQuery error()函数在IE中不起作用
- Internet Explorer JQuery Error
- Jquery error() 在 chrome 和 IE 中工作,但不能在 Firefox 中工作
- Laravel 5 : JQuery error
- wordpress jquery error Property '$'
- replaceWith jquery error
- IE8 JQuery error
- jQuery .error event
- Jquery .error方法替换
- Jquery error in URL
- jQuery error: SyntaxError: missing : after property id
- If Else JQuery error
- JQuery error()函数在IE中不工作
- Ajax Get Request with JQuery Error
- Wordpress jQuery error &
- jquery "" error