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 6216861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:19:31+00:00 2026-05-24T07:19:31+00:00

I have used google feed API to read a Rss feed url and display

  • 0

I have used google feed API to read a Rss feed url and display the title. When I call the function get_rss1_feeds directly It works fine. But when I call it with setTimeout or setInterval I am able to see only blank screen and the page does not stop loading!!

<script src="http://www.google.com/jsapi?key=AIzaSyA5m1Nc8ws2BbmPRwKu5gFradvD_hgq6G0" type="text/javascript"></script>     
<script type="text/javascript" src="jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="query.mobile-1.0a4.1.min.js"></script>
<script type="text/javascript" src="jsRss.js"></script>
<script type="text/javascript" src="notification.js"></script>

My notification.js

/** global variable **/
var Rsstitle;
/** end global variable **/

document.addEventListener("deviceready", onDeviceReady, false);
// PhoneGap is ready
//
function onDeviceReady() {
// Empty
}

function get_rss1_feeds() {
    console.log('test');               // this is being outputted
    var Rss1_title = getRss("http://yofreesamples.com/category/free-coupons/feed/?type=rss", function(entry_title) {    
        if(Rsstitle != entry_title)
        Rsstitle = entry_title;
        console.log('test1',Rsstitle); // not working
    });   
}

//get_rss1_feeds() works fine
setTimeout(get_rss1_feeds,5000); 

My jsRss.js file

    function getRss(url, callback){
    console.log('test2');            // this is being outputted 
    if(url == null) return false;
    google.load("feeds", "1");
    // Our callback function, for when a feed is loaded.
    function feedLoaded(result) {
        if (!result.error) {
            var entry = result.feed.entries[0];
            var entry_title = entry.title; // need to get this value
            callback && callback(entry_title);        
        }
    }
    function Load() {
        // Create a feed instance that will grab feed.
        var feed = new google.feeds.Feed(url);
        // Calling load sends the request off.  It requires a callback function.
        feed.load(feedLoaded);      
    }    
    google.setOnLoadCallback(Load);             
}
  • 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-24T07:19:33+00:00Added an answer on May 24, 2026 at 7:19 am

    You need to set a breakpoint in the getRss() function and see what’s going on when it’s called from setTimeout(). My guess would be that something in that function has a scoping issue and isn’t available from the global scope that setTimeout runs in, but is available from the normal scope you tried it in. It could be variables or it could be functions that aren’t available.

    This can sometimes happen if functions are declared inside another function and thus aren’t actually available globally.

    FYI, this block of code is very odd:

    var Rsstitle;
    if(Rsstitle != entry_title)         
    Rsstitle = entry_title;
    

    You can replace it with this:

    var Rsstitle = entry_title;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Many html page has an url link to the RSS feed. If you have
We have used Google form, Wufoo form to try to securely capture the info
If you've used Google Wave or iGoogle you have probably seen that you can
I currently have Google Maps integrated into my webpage. It is being used to
I have used the Google Analytics Tracker in a previous iPhone OS project. Everything
i have to display google map in my php code. for that i have
I have used the following code to open the current page URL in Rich
I have used google translator. And it has horrible grammatical problems. I am looking
I have a google map set up with markers supplied via a JSON feed.
If you have used the Google Maps web app on your iphone or ipad

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.