Thursday, 15 April 2010

jquery - Get JSON object from URL using javascript -


I am trying to get the value of the first 'price' field on the url:

< / P>

I am currently using the following code to do this:

  getJSON ('http://pubapi.cryptsy.com/api.php?pethod? Oldorderdata & amp; marketid = 132 '). Then (function (data) {var final = (data.return.DOGE.sellorders.price * totalcost) * 0.985 var ends = final.toFixed (8)  

I feel a strong I have done this wrong:

data.return.DOGE.sellorders.price

Any thoughts?

Thanks !

data.ature. DOGE.sellorders [0] .price because Sellorders is an array

< Pre class = "snippet-code-js lang-js prettyprint-override"> $ .getJSON ('http://jsbin.com/pudoki/1.json', function (data) {warning Ni (data.return .DOGE.sellorders [0] .price);});
  & lt ; Script src = "https://ajax.googleapis.com/ajax/Libs / jquery / 2.1.1 / jquery.min.js">   


No comments:

Post a Comment