我使用 .ajax 来取回通过 json (php) 传递的 html 数据。在win7上可以正常工作,但在winXP上不行。我在 php 文件的开头回显了一些发送数据的文本,但是有“空白页”回来了!
但除winXP外,在win7中一切正常。
function feedPage(div_id, feed_id, to, page){
$.ajax({
url: iloc,
type: "POST",
data: {a: "feed_page", div_id: div_id, feed_id: feed_id, page: page, to: to},
dataType: "html",
success: function(d){
var obj = eval('('+d+')');
$("#page_now").html(obj.page);
if(div_id == 1) {
div_id = 0;
}
hideButton(obj.hide_button, div_id, feed_id, obj.page);
delete obj["page"];
delete obj["hide_button"];
if(obj.rss_title) {
$("#feed_title").html("<h1>"+obj.rss_title[0]+"</h1>");
delete obj["rss_title"][0];
$("#last_page").html(obj.last_page);
}
if(obj.all_feeds) {
$(".jaunumi").append("ir");
delete obj["all_feeds"];
}
$("#feed_id ul").scrollTop(0);
$("#feed_id").empty();
for (var i in obj){
$("#feed_id").append(obj[i].title);
$("#feed_id").append(obj[i].description);
}
if(div_id == 0) {
var feed_div_offset = $("#feed_id").offset();
var feed_div_offset_top = feed_div_offset.top - 100;
$('html, body').animate({ scrollTop: feed_div_offset_top }, 'slow');
}
$(".tablo_slash").html("/");
}
});
}