http://api.jquery.com/serialize/

在要把一個FORM直接用$.POST傳給目標的網頁時, 不用傳統的form submit.

使用serialize可以將FORM的內容轉成一串參數帶給目標網頁

EX:

舊式傳送表單方法
submit();

使用$.post傳送表單方法
$.post('target.php', jQuery('#form-id').serialize(), function (ret) {
alert(ret.message);
}, 'json'

);
arrow
arrow
    全站熱搜

    dizzy03 發表在 痞客邦 留言(0) 人氣()