看板 Ajax 關於我們 聯絡資訊
※ 引述《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
shomingchang:了解 感謝 03/13 06:44