【发布时间】:2010-12-01 10:06:31
【问题描述】:
$.get("js/getflickreasy.php", function(data)
{
$(data).find("item").each(function()
{
var title = $(this).find("title").text();
var description = $(this).find("description").text();
var thumbnail = $(description).find("img").attr("src");
}
);
}
);
在 Firefox 和 Chrome 中,这可以正常工作。但在 Internet Explorer 中,变量 title 和 description 将获得值“”。缩略图未定义。我知道它在 IE 中获取数据。 getflickreasy.php 从 flickr 检索 rss。
我认为这不是IE缓存的问题,因为清除它后还是一样。可能是 IE 中的$(this).find 有问题。
您可以在my webpage查看实际代码
编辑:使用 $.get 它将检索数据,但 Internet Explorer 无法处理它。 使用 $.ajax 它现在根本不会检索数据。
编辑:我将 php 获取图像的 url 更改为:http://api.flickr.com/services/feeds/photos_public.gne?id=42980910@N02&lang=en-us&format=xml
而不是:
http://api.flickr.com/services/feeds/photos_public.gne?id=42980910@N02&lang=en-us&format=rss_200
我在 php 文件中添加了header("content-type: text/xml");。我认为它现在应该得到 xml,对吧?提琴手说:
但还是同样的问题(至少我是这么认为的)。
【问题讨论】: