Abdus Samad
Abdus Samad

Reputation: 351

Jquery ajax call response JSON format

I have a Jquery ajax call which is returning the following supposedly JSON format? I would like to know if this is really a JSON format

{"rows":["0","Success - Programming Initiated"]}

I thought the JSON format is like this below

{"rows":["status_code":"0", "status_desc" : "Success - Programming Initiated"]}

Upvotes: 0

Views: 40

Answers (1)

StackBox
StackBox

Reputation: 326

The easiest way to verify it is

  1. Open your chrome, click right and click the Inspect element
  2. open the console and assign your json to a variable

like this

var test={"rows":["status_code":"0", "status_desc" : "Success - Programming     Initiated"]}

when chrome throws error, it means that your json is incorrect.

Notice that json is combined with Array and Object,but

["status_code":"0", "status_desc" : "Success - Programming Initiated"] 

is neither an Array nor an Object, So it's incorrect.it should be

{"rows" :{"status_code":"0", "status_desc" : "Success - Programming Initiated"}}

Upvotes: 1

Related Questions