My question is this already in JSON format or just a string? I want to read the “last” entry using JSON. after lDynCoinGateIO=JSON.parse(CStr(lintRequestGateIO.responseText)
and console.log(lDynCoinGateIO[“taboo_usdt”].last) I get the error “last” is not defined.
Is this the complete output? I notice the output starts with a {, buts ends with a ". Whether is a string or a JSON object, the first and last characters should correspond to each other.
am a bit confused, if the response is already JSON does it no longer need JSON.parse? or. how can I do the query with an array? It would be awesome if it
worked with, for example, [“taboo_usdt”].last.
If you’re not sure if it’s JSON or a string, use the typeof() function. If it’s a string, using JSON.parse to convert to an object. If it’s an object, you should be able to use it as you are hoping.
i have checked with the typeof and its a string, then i use JSON.parse but i can’t use the [“taboo_usdt”].last from the JSON → Error
Uncaught TypeError: Cannot read properties of undefined (reading ‘last’)
at Object.GateIO_Done (code.js:227:46)
at i (jquery.js:2:27065)
at Object.fireWith [as resolveWith] (jquery.js:2:27828)
at z (jquery.js:4:11827)
at XMLHttpRequest. (jquery.js:4:15387)