0

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

2

1 Answer 1

4

There is a brilliant article called How to build an RSS reader with Jquery Mobile. It takes you through every step of the process.

Sign up to request clarification or add additional context in comments.

1 Comment

To be fair most of the work is actually done in php. This isn't really appropriate for a pure JQM solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.