I want to extract the XML from this link
http://212.12.182.204:8090/NewsService.svc/LatestNews
with JavaScipt, I've done and searched for loads of codes but I think the error is in the link or feed itself, I'm not sure as I'm new to this.
Thank you
EDITED PART: the code I used from google code playground:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google AJAX Search API Sample</title>
<script src="//www.google.com/jsapi?key=AIzaSyA5m1Nc8ws2BbmPRwKu5gFradvD_hgq6G0" type="text/javascript"></script>
<script type="text/javascript">
/*
* How to receive results in XML.
*/
google.load("feeds", "1");
// Our callback function, for when a feed is loaded.
function feedLoaded(result) {
if (!result.error) {
// Get and clear our content div.
var content = document.getElementById('content');
content.innerHTML = '';
// Get all items returned.
var items = result.xmlDocument.getElementsByTagName('News');
// Loop through our items
for (var i = 0; i < items.length; i++) {
var item = items[i];
// Get the title from the element. firstChild is the text node containing
// the title, and nodeValue returns the value of it.
var title = item.getElementsByTagName('Title')[0].firstChild.nodeValue;
content.appendChild(document.createTextNode(title)); // Append the title to the page
content.appendChild(document.createElement('br')); // Add a new line
}
}
else
{
alert(result.error.code);
}
}
function OnLoad() {
// Create a feed instance that will grab Digg's feed.
var feed = new google.feeds.Feed("http://212.12.182.204:8090/NewsService.svc/LatestNews");
// Request the results in XML
feed.setResultFormat(google.feeds.Feed.XML_FORMAT);
// Calling load sends the request off. It requires a callback function.
feed.load(feedLoaded);
}
google.setOnLoadCallback(OnLoad);
</script>
</head>
<body style="font-family: Arial;border: 0 none;">
<div id="content">Loading...</div>
</body>
</html>