作者icydream (巧虎)
看板Ajax
标题Re: [问题] JQuery form serialization
时间Thu Mar 13 05:57:31 2014
※ 引述《shomingchang ( )》之铭言:
: 想请问为何 var formData = $('#testform').serialize(); 序列化出来的资料是空的?
: 感谢大家
: <!DOCTYPE html>
: <html xmlns="http://www.w3.org/1999/xhtml">
: <head>
: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
: <title></title>
: <script src="Scripts/jquery-2.1.0.js"></script>
: <script type="text/javascript">
: $(document).ready(function () {
: $('#btnSerialize').on('click', Serialize);
: $('#btnDecode').on('click', Decode);
: });
...[恕删]
撷取片段的jQuery(v2.0.3)的程式码:
// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
});
由此可知,jQuery是使用name来取得elements的值
--
Xuite 板看 icydream 者作
格落部的我 [报情] 题标
2008 00:00:00 1 Jun Tue 间时
───────────────────────────────────────
My Blog ->
http://blog.xuite.net/icydream/feeling
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 119.14.60.11
1F:推 shomingchang:了解 感谢 03/13 06:44