Use the feeds' .setNumEntries() methods (as you're already doing), and if you
still need more entries, you can try the .includeHistoricalEntries() method as
well.. You can try that to get more items from the feed.
To link the items, you're going to have to adjust your code a bit.
Specifically, the code inside your for loop should look like this:
var entry = result.feed.entries[i];
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);
You may also want to use a.innerHTML = entry.title instead of
a.appendChild(document.createTextNode(entry.title)), just in case you get an
HTML entity or node in the title.
Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA
For more information or a project quote:
[email protected]
If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!
On Oct 18, 2011, at 4:30 PM, Amy at ISU wrote:
> Hi: I am successfully pulling in 2 separate feeds on
> http://coe.illinoisstate.edu/index-test.asp. I still need to have
> each item linked, but can't figure out what code to add.
>
> I would also like both feeds to display 20 items or the number of
> items in the xml file. Student Announcements feed is working
> properly, but the News feed is only rendering 4 even though the code
> is set to 20.
>
> Can you please offer guidance?
>
> 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
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> To view this message on the web, visit
> http://groups.google.com/group/google-ajax-search-api?hl=en_US
> 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 post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
To view this message on the web, visit
http://groups.google.com/group/google-ajax-search-api?hl=en_US
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en