|
|
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(); 结果就是:
<div class="quote_title"> 结果 |
|