Jump to content

getting rss news feed using jquery mobile


doforumda

Recommended Posts

I am making a mobile web app. This app will get news from yahoo. I am currently using jquery plugin to get these news. I am also using jquery mobile for interface. On the index page I have listview and it contains all the titles such as Top News, World News, Sports News etc. Here is index page code

 

<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>

 

So when USer clicks lets say Top Stories then it will take user to appropriate page and display top news on that page. Now it does take user to top news page but when he gets there he does not see any news. That page is empty. But when user refresh this page by clicking refresh button of the browser then it does show all the news. So my problem is that it should display the news as top news page is displayed.

 

here is top news page code

 

<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>

 

Can someone tell me where am I making mistake? Any solution Please

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.