Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
534 views
in Technique[技术] by (71.8m points)

接口数据只在IE内核浏览器下不显示

调用的接口在chrome、FireFox下能正常显示数据,但在ie内核的浏览器不能显示数据,不知道什么地方写的有问题,求解决方法

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=10;IE=9;IE=8;IE=7;chrome=1" />
<meta name="save" content="history" />
<script src="http://img.hexun.com/zl/tool/jquery-1.4.2.min.js"></script>
</head>
<body>
<ul id="art"></ul>
<script>
$(function(){
    getProData();
})
function getProData(){
    jQuery.ajax({dataType: "jsonp", type: "get", url:"http://open.tool.hexun.com/MongodbNewsService/getNewsListToJsonByPid.jsp?callback=getPro&pid=187804274&num=10"});
}
function getPro(data){
    var arr = [];
    var _data=data.result;
    var len = _data.length;
    for(var i=0;i<len;i++){
        var Dsstit=_data[i].title;
        var Dssurl=_data[i].entityurl;
        var Dsstime=_data[i].entitytime;
        if(len > 1){
            document.write(arr.push("<li><a href='"+Dssurl+"' target='_blank'>"+Dsstit+"</a><span>"+Dsstime+"</span></li>"))
        }
    };$("#art").html(arr.join(''));
}
</script>
</body>
</html>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

我测试是正常的,查看你的浏览器设置是不是安全级别比较高,不支持jsonp


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...