Re: Feed not displaying on page

47 views
Skip to first unread message

Jeremy Geerdes

unread,
Apr 6, 2013, 10:15:23 PM4/6/13
to google-ajax...@googlegroups.com
Where is var ul defined? My guess is that the script is puking on the line reading ul.appendChild(li). It may process all of the entries but never display them because it doesn't know what ul is, but I would guess it just errors out on the first iteration.

If that's not the problem (i.e., you've defined ul somewhere that we're not seeing), then you're going to want to provide a link to the page so we can take a closer look with some debugging tools and such.

jg

On Sat, Apr 6, 2013 at 6:40 PM, Phil Ryan <philr...@googlemail.com> wrote:
Hi,
I dont think i'm too far off, so any help much appreciated. Im using this JS file to place my blog feed into an area on my main website. This is the JS file: 

google.load("feeds", "1");

function initialize() {
feed.setNumEntries(3);
feed.setResultFormat(google.feeds.Feed.JSON_FORMAT);
  feed.load(function(result) {
    if (!result.error) {
      var container = $("#tumblr-feed");
$(result.feed.entries).each(function(index,entry) {
var li = document.createElement("li");
var a = document.createElement("a");
a.setAttribute('href', entry.link);
a.appendChild(document.createTextNode(entry.title));
li.appendChild(a);
ul.appendChild(li);
});
}
}
google.setOnLoadCallback(initialize);


...but it's not showing up! 
Thanks! 

--
--
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...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msg/google-ajax-search-api/-/0W0ZPNZd4BMJ
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-searc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

Phil Ryan

unread,
Apr 7, 2013, 3:41:52 AM4/7/13
to google-ajax...@googlegroups.com
Hi jg,
you've probably guessed but I have no programming experience, so if there's something missing like you've noticed, its probably because i've forgotten to put it in ;-). The site is www.theusualshutterspecs.com and the code is supposed to put the latest posts within the right hand area under Latest Blog.Thank you for replying and helping, anything else you can provide will be really cool. 
Cheers!
Phil 

To view this message on the web, visit
https://groups.google.com/d/msg/google-ajax-search-api/-/0W0ZPNZd4BMJ
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+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jeremy Geerdes

unread,
Apr 7, 2013, 6:59:12 AM4/7/13
to google-ajax...@googlegroups.com
In that case, alter the line beginning var container = ... to read as follows:

var ul = document.getElementById('tumblr-feed');

jg






To view this message on the web, visit

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-searc...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Phil Ryan

unread,
Apr 9, 2013, 4:33:04 PM4/9/13
to google-ajax...@googlegroups.com
thanks Jeremy, still not working, what am I doing wrong i wonder. 

google.load("feeds", "1");

function initialize() {
feed.setNumEntries(3);

  feed.load(function(result) {
    if (!result.error) {
      var container = $("#tumblr-feed");
 var ul = document.getElementById('tumblr-feed');
$(result.feed.entries).each(function(index,entry) {
var li = document.createElement("li");
var a = document.createElement("a");
a.setAttribute('href', entry.link);
a.appendChild(document.createTextNode(entry.title));
li.appendChild(a);
ul.appendChild(li);
});
}
}
google.setOnLoadCallback(initialize);

thanks!
Phil

To view this message on the web, visit
https://groups.google.com/d/msg/google-ajax-search-api/-/0W0ZPNZd4BMJ
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+unsubscri...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

--
--
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...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-search-api+unsub...@googlegroups.com
To view this message on the web, visit

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+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages