JSON Parse Error Using jQuery.parseJSON

后端 未结 4 1765
情深已故
情深已故 2020-12-12 04:29

This code fails with an exception indicating invalid JSON:

var example = \'{ \"AKEY\": undefined }\';
jQuery.parseJSON(example);

I was able

4条回答
  •  余生分开走
    2020-12-12 05:04

    No, but null is. RFC 4627 §2.1:

    A JSON value MUST be an object, array, number, or string, or one of the following three literal names:

      false null true
    
    var example = '{ "AKEY": null }';
    

提交回复
热议问题