Hello all,
I was wondering if anyone could help me with this problem...I've been
trying to get the XML from a website, but for some reason, it stops
when I call feed.load and set up the function to do something with the
result. It's just test code; the code I have is below:
var container = document.getElementById("feed");
var feed = new google.feeds.Feed('https://www.babyage.com/rss/
new_arrivals.xml');
container.appendChild(document.createTextNode("ONE..."));
container.appendChild(document.createElement("br"));
//feed.setResultFormat(google.feeds.Feed.XML_FORMAT);//convert
to
XML format.
container.appendChild(document.createTextNode("TWO..."));
container.appendChild(document.createElement("br"));
feed.setNumEntries(20);//this ensures that 20 entries are always
loaded
container.appendChild(document.createTextNode("THREE..."));
container.appendChild(document.createElement("br"));
//by default, Google Feeds load only 4 entries.
container.appendChild(document.createTextNode("IT
WORKS!"));
container.appendChild(document.createElement("br"));
feed.load(the_result);
container.appendChild(document.createTextNode("FOUR..."));
container.appendChild(document.createElement("br"));
function the_result(result)
{
if(!result.error)
{
container.appendChild(document.createTextNode("IT WORKS!"));
}
else
{
container.appendChild(document.createTextNode("IT WORKS NOT!"));
}
}
container.appendChild(document.createElement("br"));
It completely stops at the function declaration. If anyone can let me
know why this is happening, it would be greatly appreciated.
Also, if it helps, here's my header...
<!DOCTYPE html>
<html>
<head>
<title>Deal Arrivals</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/
jquery.min.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi?
key=ABQIAAAArpsj8meHaJehCEuTe7uNixTfNKF7wIarK7yIYTpwQygZOUjikRRQtI0ZlGf0BDfKz7wmTLr0gDNUTg"></
script>
<script type ="text/javascript">
google.load("feeds","1");
//the above code was in here.
</script>
</head>
</html>
Thank you in advance,
Marvin Serrano
--
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].
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en.