jquery ajax $.param()方法序列化字符串
jQuery.param(obj)将表单元素的值转换为序列化字符串,用于URL查询字符串或Ajax请求。
param()方法创建数组或对象的序列化表示。
<script type="text/javascript"> $(document).ready(function(){ var personObj={"name":"wjy","age":27,"eyecolor":"black"}; $("button").click(function(){ $("div").text($.param(personObj)); }); }); </script> </head> <body> <button>序列化对象</button> <div></div> </body>
结果:name=wjy&age=27&eyecolor=black
http://www.w3school.com.cn/jquery/ajax_param.asp
相关推荐
TONIYH 2020-07-22
83510998 2020-07-18
wcqwcq 2020-06-26
delmarks 2020-06-14
ppsurcao 2020-06-14
tthappyer 2020-06-07
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08