google.setOnLoadCallback(initialize);
Create a Feed class object to download a feed. Specify the URL for
the JDeveloper RSS Feed to create the Feed class object.
var feed = new google.feeds.Feed
(???http://www.oracle.com/technology/products/
jdev/jdeveloper_news.xml???);
Load the RSS feed using the load(callbackFunction) method
of the Feed class.
feed.load(function(result) { });
Add a div element to the body element of the JavaScript application
to display the RSS feed results.
In the callback function obtain the div element using the
getElementById method.
var container = document.getElementById(???feed???);
Iterate over the feed results.
for (var i = 0; i < result.feed.entries.length;
i++) { }
Obtain each of the feed entries, create a div element for each of the
feed entries and add the entry title to the div element for each of the
feed entries.
var entry = result.feed.entries[i];
var div=document.createElement(???div???);
div.appendChild(document.createTextNode(entry.title))
;
Add the div element for each of the entries to the container div
element.
container.appendChild(div);
Copy the RSS Ajax JavaScript application. RSSAjax.html, shown
below, to RSSAjax.html in JDeveloper.
188 9 RSS Feed with Ajax
Strict//EN??? ???http://www.w3.org/TR/xhtml1/DTD/xhtml1-
strict.dtd???>
159