你有没有尝试过这样的:
$(document).ready(function(){
$.ajax({
url : 'http://pipes.yahoo.com/pipes/pipe.run?_id=26650603c42f41d78bfb5c5c740747d3&_render=json&_callback=pipeCallback',
dataType : 'jsonp',
complete : function(data) {
//alert(data.responseText);
//console.log(data.value);
},
error: function (xhr, status, error) {
alert(error);
}
});
});
function pipeCallback(d){
data = d;
//console.debug(d);
var arts = d.value.items;
for (var i=0; i<arts.length; i++)
{
var a = document.createElement("a");
a.setAttribute("href", arts[i].link);
a.innerHTML = "<h1>" + arts[i].title + "</h1>"
var dv = document.createElement("div");
dv.innerHTML = arts[i].description;
document.body.appendChild(a);
document.body.appendChild(dv);
}
}
是否只是测试它工作正常 也摆脱的console.log的呼叫,如果开发者工具arenot打开它在IE浏览器不会工作。
[jQuery ajax responseText'undefined'](http://stackoverflow.com/questions/5460275/jquery-ajax-responsetext-undefined) – 2012-07-05 14:28:00
的可能重复,如async所述:false是必需的。 – 2012-07-05 14:29:40
这是跨域AJAX吗?如果是这样检查出来http://forum.jquery.com/topic/cross-domain-ajax-and-ie#14737000000729148 – 2012-07-05 14:31:01