在 IE 中加载 google RSS feed
我正在使用 Google-Ajax-Feed-API 编写代码以从网站获取提要。这是我的代码。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google AJAX Feed API - Simple Example</title>
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAA5MxjlekOJilywavs2TkrKxR3jjpvUIxSLOdaAPuufKrvVh6s1RSHnixBY86Q-Ze6bbbVdDtzvnIORA"></script>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
google.load("feeds", "1");
function initialize() {
feed = new google.feeds.Feed("http://feeds.labnol.org/labnol");
feed.load(function(result)
{
if (!result.error)
{
var container = $("#feed");
for (var i = 0; i < result.feed.entries.length; i++)
{
var entry = result.feed.entries[i];
var header = $("<h2> <input type=\"checkbox\" name=\"rssItem\" /><span class=\"title\"> "+entry.title+" </span> </h2>");
var dataStr = $("<em class=\"date\">"+entry.publishedDate+"</em><p class=\"description\">"+entry.contentSnippet+"</p><a target=\"_blank\" href=\""+entry.link+"\">Read more...</a>");
var divObj = $("<div></div>");
header.appendTo(divObj);
dataStr.appendTo(divObj);
divObj.appendTo(container);
}
}
});
}
google.setOnLoadCallback(initialize);
</script>
</head>
<body>
<div id="feed"></div>
</body>
</html>
这在 mozilla 中工作得很好,但在 IE 中却不行。谁能告诉我 IE 出了什么问题吗?
I'am writing a code using Google-Ajax-Feed-API to get feed from site. Here is my code for the same.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google AJAX Feed API - Simple Example</title>
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAA5MxjlekOJilywavs2TkrKxR3jjpvUIxSLOdaAPuufKrvVh6s1RSHnixBY86Q-Ze6bbbVdDtzvnIORA"></script>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
google.load("feeds", "1");
function initialize() {
feed = new google.feeds.Feed("http://feeds.labnol.org/labnol");
feed.load(function(result)
{
if (!result.error)
{
var container = $("#feed");
for (var i = 0; i < result.feed.entries.length; i++)
{
var entry = result.feed.entries[i];
var header = $("<h2> <input type=\"checkbox\" name=\"rssItem\" /><span class=\"title\"> "+entry.title+" </span> </h2>");
var dataStr = $("<em class=\"date\">"+entry.publishedDate+"</em><p class=\"description\">"+entry.contentSnippet+"</p><a target=\"_blank\" href=\""+entry.link+"\">Read more...</a>");
var divObj = $("<div></div>");
header.appendTo(divObj);
dataStr.appendTo(divObj);
divObj.appendTo(container);
}
}
});
}
google.setOnLoadCallback(initialize);
</script>
</head>
<body>
<div id="feed"></div>
</body>
</html>
This works perfectly in mozilla but not in IE. Can anybody tell me whats going wrong in IE?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
非常奇怪的问题,一旦我更改
为
IE 中的一切就开始按预期工作。
无论如何,谢谢。
Very strange problem, as soon as i changed
to
everything starts working as expected in IE.
Thanks anyways.