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); // 禁止浏览器默认行为 evt.preventDefault(); } }
添加回答
举报
0/150
提交
取消