小白教程
所有教程
关于
Search
172.69.7.193
172.69.7.193
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Misc param”的源代码
本页内容
上一节:
Misc_noconflict
下一节:
Misc_removedata
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:$.param()}}[[Category:jquery ref misc|6]] = jQuery 杂项 param() 方法 = [[jquery ref misc|jQuery 杂项方法]] 输出序列化对象的结果: <sample title="" desc="" lang="html" hererun="1"> $("button").click(function(){ $("div").text($.param(personObj)); }); </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ personObj=new Object(); personObj.firstname="John"; personObj.lastname="Doe"; personObj.age=50; personObj.eyecolor="blue"; $("button").click(function(){ $("div").text($.param(personObj)); }); }); </script> </head> <body> <button>序列化对象</button> <div></div> </body> </html> </run> == 定义和用法 == param() 方法创建数组或对象的序列化表示形式。 序列化的值可在生成 AJAX 请求时用于 URL 查询字符串中。 == 语法 == <pre> $.param(object,trad)</pre> {| class="table table-striped table-hover" ! 参数 ! 描述 |- | object | 必需。规定要序列化的数组或对象。 |- | trad | 可选。布尔值,指定是否使用参数序列化的传统样式。 |} [[jquery ref misc|jQuery 杂项方法]]
返回至“
Misc param
”。
上一节:
Misc_noconflict
下一节:
Misc_removedata