Json.stringify () How does an error occur?

Source: Internet
Author: User

This article and we share the main is json.stringify ()Execution ErrorRelated content, come together to look at it, hope to learn JSON help you. Uncaught typeerror:converting circular structure to JSONThis error is performedJson.stringify ()exception information thrown when the Json.stringify ()used to addJSONconvert format tostringformat, withJson.parser ()mutually reinforcing. There are two ways to cause this error: 1 . There is a cyclic call in JSON format data. As an example: varobj = { Title: 'title' } Obj.content = obj; Json.stringify (obj);after execution, the console will output: uncaughtTypeError:convertingCircularstructure toJSON atObject. Stringify (native) at<Anonymous>:6:6 atObject. Injectedscript._evaluateon (<Anonymous>:875:140) atObject. Injectedscript._evaluateandwrap (<Anonymous&GT;:808:34) at Object. Injectedscript.evaluate (<Anonymous>:664:21This is a wrong way of editing, and we should prohibit this from being assigned. 2,theJSON format data level is too complex. This can be performed in a high-version browser, but it can be an error in some low-version browsers(I was inchrome.40try it out.). causeJsontoo complex most of the reasons are mistakenlyDOMorJQueryobject is assigned to a value ofJSONin the string. why is that? This is due to the fact that when the data is returned by various plug-ins, the source of the eventDomorJQueryobject, which causes this error if the encoding is not filtered. Source: Pinterest

Json.stringify () How does an error occur?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.