jQuery
共 1 篇文章
JQuery Ajax方法初实践,基础知识:serialize方法
jquery中使用ajax时常常需要拼装input数据为’username=abc&password=1111111′这种形式,用JQuery的serialize方法可以轻松的完成这个工作。 <form id="form1"> <input id="username" type="text" /> <input id="password" type="password" /> </form> 在页面的js代码里面的代码是: $("form1").serialize(); 结果就是: 结果 ’username=abc&password=1111111′
2010-11-05 16:50 · jQuery · 工作 · Ajax · jQuery