Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6026811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:29:58+00:00 2026-05-23T04:29:58+00:00

I’m trying to fetch the feeds dynamically from some source and then i wanted

  • 0

I’m trying to fetch the feeds dynamically from some source and then i wanted to display each of the link in form of list in jQuery mobile . I’m able to fetch the feeds but they are displaying normally even tough i had kept data-role="listview" and unorderedlist.listview('refresh').

enter image description here
Below is the code

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.min.js"></script>

<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
<style type="text/css">
.nstyle
{
data-role:listview;
list-style:none;
}

</style>

 <script>
  $(document).ready(function(){

      $("#toi").rssfeed("http://timesofindia.feedsportal.com/c/33039/f/533974/index.rss",{limit:5,date:false,header:false,content:false});

  });
  </script>


<script type="text/javascript">

(function($){



    var current=null;
    $.fn.rssfeed=function(url,options){
        var defaults={limit:10,header:true,titletag:'h4',date:true,content:true,snippet:true,showerror:true,errormsg:'',key:null};
        var options=$.extend(defaults,options);
        return this.each(function(i,e){var $e=$(e);
        if(!$e.hasClass('rssFeed'))$e.addClass('rssFeed');
        if(url==null)return false;
        var api="http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url;
        if(options.limit!=null)
            api+="&num="+options.limit;
        if(options.key!=null)api+="&key="+options.key;
        $.getJSON(api,function(data)
                {if(data.responseStatus==200)
        {_callback(e,data.responseData.feed,options);
        }
        else{
            if(options.showerror)
if(options.errormsg!='')
{
    var msg=options.errormsg;
    }else
    {
        var msg=data.responseDetails;
        };
        $(e).html('<div"><p>'+msg+'</p></div>');};});});};

        var _callback=function(e,feeds,options){if(!feeds){return false;
        }
var html='';
var row='odd';
if(options.header)
html+='<div>'+'<a href="'+feeds.link+'" title="'+feeds.description+'">'+feeds.title+'</a>'+'</div>';
html+='<div>'+'<ul id="tst">';
for(var i=0;i<feeds.entries.length;i++)
{var entry=feeds.entries[i];
var entryDate=new Date(entry.publishedDate);
var pubDate=entryDate.toLocaleDateString()+' '+entryDate.toLocaleTimeString();
html+='<li class="rssRow '+row+'">'+'<'+options.titletag+'><a  href="'+entry.link+'" title="View this feed at '+feeds.title+'">'+entry.title+'</a></'+options.titletag+'>'
if(options.date)html+='<div>'+pubDate+'</div>'
if(options.content)
{if(options.snippet&&entry.contentSnippet!=''){var content=entry.contentSnippet;
}else{var content=entry.content;
}

html+='<p>'+content+'</p>'}
html+='</li>';if(row=='odd'){row='even';}else{row='odd';}}
html+='</ul>'+'</div>'

$(e).html(html);
$("#tst").addClass('nstyle');
$("#tst").listview('refresh');
        };

        })(jQuery);
</script>





</head>
<body>
<div data-role="page" id="home" data-theme="e">
 <div data-role="header" >
  <h1>Times Of India</h1>
 </div>
 <div data-role="content" id="toi">
 content here
 </div>
 <div data-role="footer">
  <h4>Top News</h4>
 </div>
</div>


</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:29:59+00:00Added an answer on May 23, 2026 at 4:29 am

    Change:

    $(document).ready(function(){
        $("#toi").rssfeed("http://timesofindia.feedsportal.com/c/33039/f/533974/index.rss",{limit:5,date:false,header:false,content:false});
    
    });
    

    To:

     $(document).ready(function(){
        $('#home').live('pagebeforecreate', function(){
            $("#toi").rssfeed("http://timesofindia.feedsportal.com/c/33039/f/533974/index.rss",{limit:5,date:false,header:false,content:false});
        });
    });
    

    UPDATE:

    Is this what you’re after? http://jsfiddle.net/8EGGZ/25/

    In the end I replaced listview.refresh() with $("#toi").page(); in your callback function.

    UPDATE 2:

    Fixed the jquery-mobile issues – http://jsfiddle.net/8EGGZ/27/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i want to parse a xhtml file and display in UITableView. what is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.