I can't seem to figure out how to access the XML data from the Wolfram API. This page is a REST-style API, although I'm still learning what that means.
A sample query page is here: http://api.wolframalpha.com/v2/query?input=pi&appid=P4R357-G2X7K6U2J5
How would I use AJAX to access and use the XML data from this page?
I copied and modified this code, which worked for a json page. However, I don't know how to get the data from the Wolfram API XML page. With this code, I believe that seeing a message of "Success" means that I have successfully gotten the url.
I will worry about the formatting after I figure out how to just get the data.
I am very new to this, so any help would be greatly appreciated. Thanks a lot!
$(document).ready(function() {
$.ajax({
type: "GET",
url: "http://api.wolframalpha.com/v2/query?input=pi&appid=P4R357-G2X7K6U2J5",
dataType: "xml",
success: function(xml){
document.write("Success");
}
}).then(function(data) {
document.write("Success");
});
});