$.ajax({
type: "POST",
url: "http://www.weather.com.cn/data/sk/101010100.html",
data: {},
dataType: "json",
async: false,
success: function (rest) {
var datr = rest.weatherinfo;
alert(datr);
} })在网上找了一个天气预报的接口,alert是空,求解···jsonasp.net
type: "POST",
url: "http://www.weather.com.cn/data/sk/101010100.html",
data: {},
dataType: "json",
async: false,
success: function (rest) {
var datr = rest.weatherinfo;
alert(datr);
} })在网上找了一个天气预报的接口,alert是空,求解···jsonasp.net
http://www.cnblogs.com/guowei1027/archive/2009/12/15/1625170.html
可能出现这个错误,参照:
http://blog.csdn.net/meditatorzhang/article/details/7612458
<script type="text/javascript">
$.ajax({
url:"http://xxx.com/xxx.xxx",
dataType:'jsonp',
data:'',
jsonp:'callback',
success:function(result) { },
timeout:3000
});
</script>