Accessing the coinbase API https://coinbase.com/api/doc/1.0/currencies/exchange_rates.html In my case i have text boxes with Bitcoin field and other currencies field(usd,gbp,eur etc..) Code:
<h6>BTC</h6>
<input type="text" id ="coin"/>
<div class="row">
<h6>USD</h6>
<input type="text" id='usd'/>
</div>
<div class="row">
<h6>GBP</h6>
<input type="text" id="gbp"/>
</div>
javascript
$(document).ready(function () {
$('#coin').keyup(function () {
var url = 'https://coinbase.com/api/v1/currencies/exchange_rates?callback=?';
$.getJSON(url, function (data) {
});
});
});
Error
SyntaxError: missing ; before statement
{"vnd_to_usd":"4.7e-05","ars_to_btc":"0.00021","mmk_to_btc":"2.0e-06","ye..