jQuery API jQuery API 中英文对照版
serialize()
serialize()

把Input元素的内容连接成为一个请求字符串

返回值:String

示例:

Serialize a selection of input elements to a string

HTML 代码:

<input type='text' name='name' value='John'/>
<input type='text' name='location' value='Boston'/>

jQuery 代码:

$("input[@type=text]").serialize();

 

serialize()

Serializes a set of input elements into a string of data. This will serialize all given elements.

A serialization designed to emulate the actual form submission of a browser is provided by the Form Plugin. The plugin's formSerialize method correctly handles multiple-selects and identically-named checkboxes as arrays, whereas the serialize method recognizes only a single value for these elements.

Return value: String
Example:

Serialize a selection of input elements to a string

 $("input[@type=text]").serialize();  
Before:
 <input type='text' name='name' value='John'/>
 <input type='text' name='location' value='Boston'/>  
Result:
 name=John&location=Boston  
相关链接
WEB开发网 | PHP教程 | Mysql教程 | Apache教程 | 最新文章 | PHP面试题| 网站地图 | Google地图 | Baidu地图 | 在线WEB论坛

WEB技术QQ交流群:245735*** 站长Q号:245735***
版权所有者:WEB开发网 地址:云南省文山州砚山县盘龙乡 滇ICP备12002707号-10
特别声明:本站内容仅供参考,不作为设计及确切依据!想了解更多,可立即进入Bbs提问