當前位置:名人名言大全網 - 短信平臺 - js或者asp如何解析網易新聞api?

js或者asp如何解析網易新聞api?

用jquery的jsonp可以獲取到裏面的數據,然後隨機數抽取壹個就行

效果在控制臺裏如圖

<script>

$.ajax(妳的那個API地址(我發鏈接可能會被刪掉), {

type: "get",

dataType: "jsonp",?

jsonpCallback: "artiList",?

success: function(d){

var index = parseInt(Math.random() *?d.BA10TA81wangning.length);

console.log(d.BA10TA81wangning[index].title)

}

})

</script>