There are several questions regarding this topic, but I cannot seem to find one that works for me. So far I am doing this:
load() {
var url1 = "http://tourify.herokuapp.com/json/?lat=51.4346644&lng=-0.1020241&address=15%20Chestnut%20Road,%20West%20Norwood,%20London%20SE27%209EZ,%20UK";
// call the web server asynchronously
var request1 = HttpRequest.getString(url1).then(display);
}
Here is the other function:
display(String responseText) {
String jsonString = responseText;
window.alert(jsonString);
}
I get this error:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access.
Exception: Uncaught Error: Instance of '_XMLHttpRequestProgressEvent'
Is there an easy way to just open the connection for anywhere?
Thanks, Luca