用js原生的方法实现,不要用jquery,url是http://fxinfo.api.fxhelper.cn/news/bignewnews.js,该怎么写?

解决方案 »

  1.   

     <div id="body" ></div>
    <script>
      var url="http://fxinfo.api.fxhelper.cn/news/bignewnews.js"
      var req=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
      req.open("GET",url,false);
      req.send(null);
      eval( ' var data='+ req.responseText);
      var html=[];
      for(var i=0;i< data.length;i++ ){
       html.push( '<li>title:'+ data[i].Value.strtitle +'</li>' );
      }
      document.getElementById('body').innerHTML=html.join('');
     </script>