Я изучаю XML, и я нашел веб-сайт, который имеет канал XML. Я пытаюсь выяснить, есть ли способ совершать межсерверные вызовы ajax?
Код, который я использую ниже:
<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>