function initData(){
var time = new Date().getTime();
var url2 = "http://hq2gjqh.eastmoney.com/EM_Futures2010NumericApplication/Index.aspx";
$.get(url2,{jsName:"fxrc",Type:"S",SortType:"A",pageSize:"20",page:"1",style:"28CrossRate",_g:time},
function(data){
alert(data);
},"text");
}
$(document).ready(function(){
initData();
});
上面代码中alert(data)在火狐浏览器中取出是空字符串,在IE里面是好的,各位帮忙看看!
Jquery?ajax
------解决方案--------------------
跨域了,无法获取跨域内容的,IE本地测试可以,发布了也不行
需要自己做代理获取跨域的数据
你的这个可以用$.getScript[参数要自己组合起来],而不是$.get
<script src="http://www.coding123.net/js/jquery.js"></script>
<script>
function initData(){
var time = new Date().getTime();
var url2 = "http://hq2gjqh.eastmoney.com/EM_Futures2010NumericApplication/Index.aspx?"+$.param({jsName:"fxrc",Type:"S",SortType:"A",pageSize:"20",page:"1",style:"28CrossRate",_g:time}) ;
$.getScript(url2,function(){
alert(fxrc.rank);
},"text");
}
$(document).ready(function(){
initData();
});
</script>