@
yrdr 试过jsonp了,还是不行。用jquery和用原生Js代码的Jsonp都返回403 forbidden。
Jquery:
<script type="text/javascript">
function haha(){
$.ajax({
type : "get",
async:false,
url : "
http://fm.xinli001.com/broadcast/",
data: "pk=97701348&t=1419336731430",
dataType: "jsonp",
jsonpCallback:"fmHandler",
headers:{
"Referer":"
http://fm.xinli001.com/",
"X-Requested-With":"XMLHttpRequest",
"Accept":"*/*",
"Accept-Encoding":"gzip, deflate",
"Accept-Language":" zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3",
"Connection":"keep-alive",
"Host":"
fm.xinli001.com",
"User-Agent":"Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0",
},
success : function(json){
console.log(json);
alert('ok');
},
error:function(){
alert('fail');
}
});
}
</script>
原生Js:
<script type="text/javascript">
var myFmHandler = function(data){
alert('ok');
};
var url = "
http://fm.xinli001.com/broadcast/?pk=97701348&t=1419336731430&callback=myFmHandler";
var script = document.createElement('script');
script.setAttribute('src', url);
document.getElementsByTagName('head')[0].appendChild(script);
</script>
楼上说的Node.js,我没用过,现在来现学现用一下。。。