js代码<script language="javascript">
var url=$('#url').val();
function countryChange(obj){
var countryid=obj.value;
$.ajax({
url : url,
type: "GET",
data :{country:countryid},
dataType : "json",
cache : false,
error : function(XMLHttpRequest, textStatus, errorThrown) {
alert("error: " + XMLHttpRequest.status+' '+textStatus);
},
success : function(data, textStatus) {
alert(data);
}
});
}
</script>后台代码也没有问题,如果直接输入URL,返回值是正确的,如{"country_id":"535"}
中间好像有个跳转,返回值是一个整个的页面代码,将插件名称都带来出来,当然,返回值{"country_id":"535"} 也在其中
var url=$('#url').val();
function countryChange(obj){
var countryid=obj.value;
$.ajax({
url : url,
type: "GET",
data :{country:countryid},
dataType : "json",
cache : false,
error : function(XMLHttpRequest, textStatus, errorThrown) {
alert("error: " + XMLHttpRequest.status+' '+textStatus);
},
success : function(data, textStatus) {
alert(data);
}
});
}
</script>后台代码也没有问题,如果直接输入URL,返回值是正确的,如{"country_id":"535"}
中间好像有个跳转,返回值是一个整个的页面代码,将插件名称都带来出来,当然,返回值{"country_id":"535"} 也在其中
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货