JSON data reorganization

Source: Internet
Author: User
serializeArray()function is used to serialize a set of form elements and encode the contents of the form into a single JavaScript array .

serializeArray()Functions are commonly used to serialize the contents of a form into a JSON object, so that it is encoded in a JSON-formatted string.

The function encapsulates each form control that is available for submission as an object that has the name and Value property, the name of the form control, and the Value property. These object objects are then encapsulated as an array and returned.

The function does not serialize form controls that do not need to be submitted, which is consistent with the regular form submission behavior. For example: a form control that is not in a <form> tag is not committed, a form control without a name attribute is not committed, a form control with the disabled property is not committed, and a form control that is not selected is not committed.




var tmp = {};
$ (' #serverManagementInfo '). Serializearray (). Map (function (x) {
Tmp[x.name] = X.value;
});

JSON data reorganization

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.