I am learning XML and I’ve found a website that has a XML feed. I am trying to figure out if there is a way to make cross server ajax calls?
The code I am using is below:
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<script>
$.ajax({
type: "GET",
url: "http://www.nfl.com/liveupdate/scorestrip/ss.xml",
dataType: "xml",
success: function(xml) {
// Interpret response
$(xml).find('g').each(function() {
// Example: Show the XML tag in the console
console.log(this);
// Example: Put some output in the DOM
$("#divOutput").append($(this).attr("hnn"));
});
$(xml).find('g').each(function() {
// Example: Put some output in the DOM
$("#divOutput").append($(this).attr("k"));
})
}
});
</script>
<div id="divOutput"></div>
</body>
</html>
The only ways for you to make cross domain ajax requests (that I’m aware of) are:
In this case, it looks like you can’t do any of these, so you’re out of luck.