Re: [問題] JQuery form serialization
※ 引述《shomingchang ( )》之銘言:
: 想請問為何 var formData = $('#testform').serialize(); 序列化出來的資料是空的?
: 感謝大家
: <!DOCTYPE html>
: <html xmlns="" rel="nofollow">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
推
03/13 06:44, , 1F
03/13 06:44, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章