Thanks!

That worked great for my translator:
Used to be:
    google.load("language", "1");
    google.setOnLoadCallback(init);



Now It is:
 google.load('language', '1', {callback : function(){
 init();
 }});


Thanks!


Em sexta-feira, 5 de agosto de 2011 01h19min56s UTC-3, yesh escreveu:
>
> 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 
> <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 
> <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); 
>     } 
>
> I did just as you said. console.log at the start of both the functions 
> are being outputted (I have documented it inside the code). This is 
> the entire code I am working on. I am planing to use more than one Rss 
> feed so I will be creating similar functions like get_rss2_feeds etc 
> and each of them will have there own setTimeout method which will be 
> calling them at unique time intervals. 
>
> I did debug it using the breakpoint in my chrome as you said.I set the 
> breakpoint on my getrss function the page is being displayed when the 
> breakpoint move to google.setOnLoadCallback(Load); the page goes 
> blank. Then it comes out of getRss function and comes out of 
> get_rss1_feeds() function. – 
>
> Could someone help me solve this problem.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax-search-api@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-search-api+unsubscr...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msgid/google-ajax-search-api/c6c428b0-f3ec-41c6-bf5f-27e3ebc9f504%40googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-ajax-search-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to