js Form表單轉json格式,及後臺接收(多種方法)

  1、serialize()方法 格式:var data = $("#formID").serialize();ajax 功能:將表單內容序列化成一個字符串。json 注意:要使用params = decodeURIComponent(data ,true)進行解碼,否則中文數據會亂碼。數組 數據示例:Name=小明&Age=22&Sex=男函數 後臺:獲取字符串後,能夠到後臺進行處理數據。po
相關文章
相關標籤/搜索