当前位置: 代码迷 >> 综合 >> jquery 跨域访问插件
  详细解决方案

jquery 跨域访问插件

热度:35   发布时间:2024-01-21 08:19:24.0
demo用法

$.ajax({
url : myurl,//要访问的地址
type : 'GET',
success : function(res) {

alert(parseJson(res));


}
});

function parseJson(res) {

var strjson;
var i=0;
var ps = $(res.responseText).filter(function() {
return $(this).is('p')
});

ps.each(function() {

strjson=$(this).html();
if(++i>1){
return;
}


});

return eval('('+strjson+')');
}
  相关解决方案