Javascript cramming issue in Wolfram API JavaScript

How can I make wolfram api work? I just get cross-origin errors and an empty answer: "XMLHttpRequest cannot load http://api.wolframalpha.com/v2/query?input=No&appid=xxx . Source null (or other site) not allowed Access-Control-Allow -Origin. "

The code

var request = new XMLHttpRequest(); request.open("GET", "http://api.wolframalpha.com/v2/query?input=pi&appid=xxx", true); request.onreadystatechange = function() { if(request.readyState == 4) { console.log("*"+request.responseText+"*"); } } 

Thanks a bunch

+4
source share
1 answer

The Wolfram API does not allow JavaScript requests. To request an API, you will need to use the server library.

+5
source

All Articles