比如这个:
http://api.t.sohu.com/statuses/public_timeline.json

解决方案 »

  1.   

    貌似json的格式的键值对吧!~~~~~~不知道键的值!~~~
      

  2.   

    用  jsonp 或 自己的服务器做代理。
      

  3.   

    动态创建script元素。
    function getScipt(url){
      var scirpttag = document.createElement("script");
      scripttag.setAttribute("type","text/javascirpt");
      scripttag.setAttribute("src",url);
      document.getElementsByTagName("head")[0].appendChild(scirpttag);
    }
    getScipt("http://api.t.sohu.com/statuses/public_timeline.json");
    这样你就可以访问从url中返回的json中的数据了
      

  4.   

    跨域用代理,或是用服务器端的httpclient
      

  5.   

    3# 正解 script 可以跨越请求
     // 动态导入js
    function include(src,encoding,fun) 

        var s = document.createElement('script');   
        s.type='text/javascript';
        s.charset=encoding; //'gb2312';
        s.src = src;   
        var tags =document.getElementsByTagName('head');   
       if(typeof(fun)=='function'){
            if( document.all ){
               s.onreadystatechange = function(){
                    if(/(complete|loaded)/.test(this.readyState)){
                          fun(); s.onreadystatechange = null; s.parentNode.removeChild(s); 
                     }};
           }else{
                 s.onload = function(){  fun(); s.onload = null; s.parentNode.removeChild(s); };
           }
        } 
        tags[0].appendChild(s); 
    };
      

  6.   

       function find()
            {
                var F = "http://api.t.sohu.com/statuses/public_timeline.json
    ";
                $.getJSON(F, w); //前者为地址,后者为回调函数
            }
            function w(M)
            {
       alert("created_at:" + M.created_at);           
            }
      

  7.   

    Jquery
    function find()
      {
      var F = "http://api.t.sohu.com/statuses/public_timeline.json
    ";
      $.getJSON(F, w); //前者为地址,后者为回调函数
      }
      function w(M)
      {
      alert("created_at:" + M.created_at);
      }
      

  8.   

    建议楼主去使用下比较主流的js开源库,一般主流的ajax库都可以,包含的封装的ajax请求,有跨域和非跨域限制的。