JSON stringify missing from jQuery 1.4.1?

后端 未结 6 984
野性不改
野性不改 2020-12-02 19:28

Apparently jQuery has the ability to decode a given object or string into a JSON object. However, I have a JS object that I need to POST back to the server and I find no uti

6条回答
  •  孤城傲影
    2020-12-02 20:24

    jQuery does not need this functionality internally and thus does not provide a convenience method to do so.

    JSON.stringify() is the standard and recommended way of encoding an object to a JSON string representation of that object. It is a method of the native JSON object in many browsers, and it is recommended you use json2.js (https://github.com/douglascrockford/JSON-js) to provide a fallback.

提交回复
热议问题