1.serialize () methodFormat: var data = $ ("form"). Serialize ();Function: Serializes the contents of the form into a single string.This way, when Ajax submits the form data, it is not necessary to enumerate each parameter. Simply set the data
Like other methods in jquery, the Serialize () method acts on a jquery object, which serializes the DOM element content into a string for AJAX requests. By using the Serialize () method, you can submit all the fields of this page,The code is as
This article from: http://www.coolcode.cn /? P = 171Author: Ma bingyao
Previously written phprpc implementation, the Javascript version of the serialization implementation is modified from the http://www.devpro.it/code/102.html, this implementation
This article mainly introduces the usage of serialize () in JQuery. The example analyzes the functions, definitions, and related usage skills of the serialize () method, for more information about how to use serialize () in JQuery, see the following
The original instructions and some summary in the manual: Descriptions and cases of php functions serialize () and unserialize. To change serialized strings back to PHP values, use unserialize (). Serialize () can process any type other than
So then Lenovo to the object in PHP how to serialize storage cost-effective? Then I thought about the JSON encoding and decoding functions recommended by my colleagues.
According to him, Json_encode and json_decode are more efficient than the
In jquery Ajax, data is sent to the server in the form of a key-value pair (Key/value), which can be serialized as a key-value pair using the jquery Ajax Serialize () method form when submitting form data using AJAX (key1=value1&key2= Value2 ... )
Serialization is the process of converting a data structure or object to a sequence of bits so then it can be stored in A file or memory buffer, or transmitted across a network connection link to being reconstructed later in the same or another
PHP serialize serialized data and JSON formatted data analysis, Serializejson
PHP's serialize is to serialize variables, return a string expression with variable type and structure, and JSON is a lighter and friendlier format for interface (AJAX,
PHP's serialize is to serialize the variable, returning a string expression with variable type and structure, while JSON is a lighter and friendlier format for interface (AJAX, rest, and so on) data interchange. In fact, both are in a string of ways
For JSON (JavaScript Object Notation) Everyone should be familiar, it is a lightweight data interchange format. Easy for people to read and write. It is also easy for machine parsing and generation. It is based on JavaScript programming Language,
In general, if we cache the array into a file, we need to convert it into a string first, and then store it in a text file. Generally, there are two mechanisms to convert the array into a string,
In general, if we cache the array into a file, we
Serialize () serialization function of PHP. The explanations of serialize () and unserialize () in the php Manual are: serialize-Generatesastorablerepresentationofavalue, which generates a representation of the stored values.
When submitting a form through jquery Ajax, the form content is usually obtained in the following way.varform = ' Add-account-form '; //form ID $ (' # ' + form). Submit (function() {varAccount = { ' user_id ': ',
In jquery, we can directly use serialize () to convert ajax submitted forms. In this way, the input in the form name is converted to the get method. If we have a large number of parameters, we do not need to fill them out.
Data in jQuery ajax is
The following is the server-side JSP code:
" +username+ ": " +content+
" ");
%>
Like other methods in jquery, the Serialize () method acts on a jquery object, which serializes the DOM element content into a string for AJAX requests.
Serialize () and unserialize () are explained in the PHP manual:
Serialize-generates a storable representation of a value
Serialize-produces a representation of a value that can be stored
Unserialize-creates a PHP value from a stored
The original words and summary in the manual:Description and case of php functions serialize () and unserialize. To change serialized strings back to PHP values, use unserialize (). Serialize () can process any type other than resource. Even
Four serialization methods, json_encode, serialize, igbinary, and msgpack, have been tested before. PHP5.5 has not been tested yet. this test is based on PHP5.5 and has test cases, h...
Four serialization methods, json_encode, serialize, igbinary,
Serialize () and unserialize () are described in the php manual as follows:
Serialize-Generates a storable representation of a value
Serialize-generate a representation of a stored value
Unserialize-Creates a PHP value from a stored
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.