ERROR XMLHttpRequest cannot load - No 'Access-Control-Allow-Origin' header is present on the requested resource.
//XMLHttpRequest
var xhr = new XMLHttpRequest();
if (!('withCredentials' in xhr)) {
alert('Browser does not support CORS.');
return;
}
xhr.onerror = function() {
alert('There was an error.');
};
xhr.onload = function() {"done"}
xhr.open("GET", "http://indicadoreseconomicos.bccr.fi.cr/indicadoreseconomicos/WebServices/wsIndicadoresEconomicos.asmx/ObtenerIndicadoresEconomicos?tcIndicador=318&tcFechaInicio=01/03/2014&tcFechaFinal=01/01/2016&tcNombre=A&tnSubNiveles=N",true);
xhr.send(null);
console.log("loading >>>")
</script>
</head>
<body>
</body>
</html>