$.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 

解决方案 »

  1.   

    跨域正常的方法是获得不到的,看看下链接的Case III. iframe方式 (on Server A)
    http://www.cnblogs.com/guowei1027/archive/2009/12/15/1625170.html
      

  2.   

    你可以在后台通过构造http访问来获取对象后提交给前台显示(ajaxpro这个东西可以让前台js执行后台的代码)
      

  3.   

    跨域你就不能那么post了。  得用jsonp
      

  4.   

    type: "GET"
    可能出现这个错误,参照:
    http://blog.csdn.net/meditatorzhang/article/details/7612458
      

  5.   


    <script type="text/javascript">  
        $.ajax({  
            url:"http://xxx.com/xxx.xxx",  
            dataType:'jsonp',  
            data:'',  
            jsonp:'callback',  
            success:function(result) {          },  
            timeout:3000  
        });  
    </script>  
      

  6.   

    jsonp只直接get,而且需要服务端支持