<script type="text/javascript">
function test(){
var form = new FormData(document.getElementById("uploadForm"));
$.ajax({
url:"/uploadController/readExcel",
type: 'POST',
data:form,
dataType:"json",
processData: false, // 告訴jQuery不要去處理髮送的數據
contentType: false, // 告訴jQuery不要去設置Content-Type請求頭,
// contentType: 'application/json' 向後臺傳值爲json格
// 式,需要與JSON.stringify({ stuID: stuID2 })使用
success: function (result) {
console.log('Send successful..'); // 請求成功後的回調函數, result 爲響應內容
},
error: function () {
console.log('Send Request Fail..'); // 請求失敗時的回調函數
}
});
}
</script>