I am trying to write simple webpage that use js to get me some information stock prices. So, I am wondering if I can make an HTTP request from a localhost to a website. So far, I am getting a Access-Control-Allow-Origin
error. and I wounder if the problem has to do with cross domain access or is it just because I am using a localhost?
<html>
<header>
</header>
<body>
<p id="price"></p>
<script>
var url = "https://api.gemini.com/v1/pubticker/BTCUSD";
var con = new XMLHttpRequest();
con.open('GET', url, true);
con.send();
document.getElementById("price").innerHTML = con.responseText;
</script>
</body>
</html>