Called $. param
a tool function that enables an object or array to be serialized in a format that is key/value
often used to send a URL request to the server with the following format:
$. param (obj);
The parameter obj represents the object that needs to be serialized, and the object can be an array, and the entire function returns a serialized encoded string.
<body> <div id= "Divtest" > <div class= "title" > <span class= "FL" >url operation function </sp an> </div> <div class= "Content" > <div class= "Tip" ></div> </ div> </div> <script type= "Text/javascript" > $(function () { //Basic Information Object varObjinfo =NewObject (); Objinfo.name= "Bai Fu Mei"; Objinfo.sex= 1; //Serializing Objects varObjnewinfo =$.param (Objinfo); //Display the serialized object varstrtmp = "<b> object white rich after serialization </b>:<br/><br/>"; Strtmp+=Objnewinfo; //Show in Page$ (". Tip"). Show (). append (strtmp); }); </script></body>
Results:
object White Rich after serialization :
Name=%e7%99%bd%e5%af%8c%e7%be%8e&sex=1
JQuery Tool class function-url operation function