JSON Format or just a String


I get the following after a PHP query:


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.

How can I solve this?

Thanks for your answer.

Kind regards


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.

You can validate JSON data on this site.

Many thanks for your answer. The Response from server is in JSON Format, i have checked with the Site. Now the Response looks like:

{‘taboo_usdt’:{‘result’: ‘true’,‘last’: ‘0.001945’,‘lowestAsk’: ‘0.001949’,‘highestBid’: ‘0.001937’}, “op3l_usdt”:“result”:“true”,“last”:“3.8063”,“lowestAsk”:“3.7757”,“highestBid”:“3.7231”,“percentChange”:“12.65”,“baseVolume”:“2793.436071”,“quoteVolume”:“797.255”,“high24hr”:“3.8063”,

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.

many thanks for your support

kind regards


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)

What does your JSON.parse() statement look like?


works, the following entry in the PHP file was the solution. thanks for the support

header(‘Content-type: application/json’);

kind regards