【发布时间】:2011-09-26 07:02:47
【问题描述】:
我正在制作一个移动网络应用程序。这个应用程序将获得来自雅虎的消息。我目前正在使用 jquery 插件来获取这些消息。我也在使用 jquery mobile 作为界面。在索引页面上,我有列表视图,它包含所有标题,例如热门新闻、世界新闻、体育新闻等。这是索引页面代码
<html>
<head>
<title>Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width = device-width, initial-scale = 1, user-scalable = no" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.css" />
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.js"></script>
</head>
<body>
<div data-role="page">
<header data-role="header">
<h1>Yahoo News</h1>
</header>
<div data-role="content">
<ul data-role="listview" data-inset="true">
<li><a href="topNews.php" data-transition="slidedown">Top Stories</a></li>
<li><a href="worldNews.php" data-transition="slidedown">World News</a></li>
<li><a href="techNews.php" data-transition="slidedown">Technology</a></li>
<li><a href="scienceNews.php" data-transition="slidedown">Science</a></li>
<li><a href="enterNews.php" data-transition="slidedown">Entertainment</a></li>
<li><a href="sportsNews.php" data-transition="slidedown">Sports</a></li>
</ul>
</div>
<footer data-role="footer">
<h4>Footer</h4>
</footer>
</div>
</body>
因此,当用户点击让我们说热门故事时,它会将用户带到适当的页面并在该页面上显示热门新闻。现在它确实将用户带到了热门新闻页面,但是当他到达那里时,他没有看到任何新闻。那一页是空的。但是当用户通过单击浏览器的刷新按钮刷新此页面时,它会显示所有新闻。所以我的问题是它应该在显示热门新闻页面时显示新闻。
这里是头条新闻页面代码
<html>
<head>
<title>Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width = device-width, initial-scale = 1, user-scalable = no" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.css" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.js"></script>
<script language="javascript" type="text/javascript" src="jquery.jfeed.js"></script>
<script language="javascript" type="text/javascript" src="jquery.aRSSFeed.js"></script>
<script type="text/javascript">
$(document).ready( function() {
$('div.RSSAggrCont').aRSSFeed();
});
</script>
</head>
<body>
<div data-role="page">
<header data-role="header">
<a href="#" data-transition="slidedown" data-rel="back" data-icon="arrow-l">Back</a>
<h1>Top News</h1>
</header>
<div data-role="content">
<div class="RSSAggrCont" rssnum="5" rss_url="http://rss.news.yahoo.com/rss/topstories">
</div>
</div>
<footer data-role="footer">
<h4>Footer</h4>
</footer>
</div>
</body>
谁能告诉我我在哪里犯错了?任何解决方案请
【问题讨论】:
-
听起来 RSS 提要插件有问题。您从哪里下载 aRSSFeed.js 文件?
标签: jquery html css jquery-plugins jquery-mobile