How do I fetch Bitstamp's last price quote from their
JSON ticker api and have it on my website as plain text?
Here's what I tried with no luck,
Attempt 1)
<div id="pricebar">
Buy Price: <span id="buyprice"> </span><br>
Sell Price: <span id="bidprice"> </span><br>
</div>
<script>
$.ajax(
type:'GET',
url: "https://www.bitstamp.net/api/ticker/",
success:function(feed) {
var priceobj = {
"liveprice":"last",
"bidprice":"bid",
};
document.getElementById("buyprice").innerHTML=priceobj.liveprice;
document.getElementById("bidprice").innerHTML=priceobj.bidprice;
},
datatype:'jsonp'
</script>
I was told that it has to be jsonp, and not json (because I'm using an external url source).
Is it possible to use JSONP just from Jquery+HTML+javascript to embed prices in plain text?
If not Bitstamp's api can I use BitcoinChart's, or
Blockchain's API?