Serialize serialization usage

Source: Internet
Author: User

Today, I found a serialize method in jquery while reading the source code. I have carefully studied it. Now I want to write it out and consolidate it.
In our normal form submission, we often need to extract a form one by one, which is difficult to use ajax in jquery. Therefore, with this function, we can use serialize () in jquery () serialization value of the method, which is convenient for us to process quickly and easily. Now let's take a look at what is serialize
 
First, create a simple test.html page on the side of my vimeditor:
 
<Html>
<Head>
<Title> Serilize </title>
<Script type = "text/javascript" src = "./jquery. js"> </script>
<Script type = "text/javascript">
Function s (){
Var input = $ ('input'). serialize (); // serialized Value
Alert (input );
}
</Script>
</Head>
<Body>
<Form method = "post" action = "" onSubmit = "s ()">
Name: <input type = "text" name = "name"/> <br>
Sex: <input type = "text" name = "sex"/> <br>
Phone: <input type = "text" name = "phone"/> <br>
Email: <input type = "text" name = "email"/> <br>
QQ: <input type = "text" name = "qq"/> <br>
<Input name = "submit" type = "submit" value = "CLICK"/>
</Form>
</Body>
</Html>
 
 
 
 
Now you paste the above Code into your editor and save the test and submit it. The following window will pop up:
 
 
Of course, you may be confused why the serialized value is garbled, which uses the json_encode (); function for translation !!
Now, let's write it here. If you don't understand it, Let's post it !!!
Author "You_Can"

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.