function serialize(form) { var parts = [], elems = form.elements, i = 0, len = elems.length, filed = null; for (; i < len; i++) { filed = elems[i]; switch (filed.type) { case "select-one": case "select-multiple": if (filed.name.leng…
有一个form表单,要用AJAX后台提交,原来想拼接json,但是数据多了麻烦,不灵活. 用HTML5的FormData来初始化表单 var formdata=new FormData(document.getElementById("advForm")); 看似还可以,但发现有两个问题, 一,formdata.get()方法不知为什么用不了 二,Form Data 数据格式不如Jq的简洁, WebKitFormBoundary29h06FRZequJgQtR var stu={ na…