好库网 好库网首页 | 我的好库
JQuery入门

formSerialize(true)-JQuery API

发布者:jquery2000
发布日期:2011/4/6 15:34:19   更新日期:2011/4/6 15:34:19
阅读次数:4004
评分:4.80
介绍:formSerialize(true) 将form数据序列化到'submittable'(可提交)的字符串。
正文:

 

formSerialize(true)

将form数据序列化到'submittable'(可提交)的字符串。

This method will return a string in the format: name1=value1&name2=value2 The semantic argument can be used to force form serialization in semantic order. If your form must be submitted with name/value pairs in semantic order then pass true for this arg, otherwise pass false (or nothing) to avoid the overhead for this logic (which can be significant for very large forms).

 

返回值

String

 

参数

true (semantic): if serialization must maintain strict semantic ordering of elements (slower) 

示例

说明:

Collect all the data from a form into a single string

 

jQuery 代码:

var data = $("#myForm").formSerialize(); $.ajax('POST', "myscript.cgi", data);

 


评论 [发表评论]
账号 密码 还没帐号呢,现在注册一个?

免责声明:好库网所展示的信息由买卖双方自行提供,其真实性、准确性和合法性由信息发布人负责。好库网不提供任何保证,并不承担任何法律责任。