I am a complete beginner with JavaScript and jQuery.
When I query my API I will normally get JSON like this:
{ "soc": 9271, "series": [ { "year": 2013, "estpay": 370 }, { "year": 2012, "estpay": 430 } ] } However if my query is invalid I will get JSON like this:
{ "error": "Some message here . . . .." } So my question is - what is the syntax to detect the error message and then set up an IF / ELSE type of response? i.e. If error message do this.. If no error message do something else.