window.onload = function(){ var fm = document.getElementsByTagName('form')[0]; fm.onsubmit = function(evt){ var fd = new FormData(fm); var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(){ if(xhr.readyState == 4){ alert(xhr.responseText); } } xhr.open('post', './personel_save.php'); xhr.send(fd); // 禁止瀏覽器默認(rèn)行為 evt.preventDefault(); } }
1 回答
- 1 回答
- 0 關(guān)注
- 2347 瀏覽
添加回答
舉報(bào)
0/150
提交
取消