var xmlResquest = new XMLHttpRequest();
xmlResquest.open("POST", "/download", true);
xmlResquest.setRequestHeader("Content-type", "application/json");
xmlResquest.setRequestHeader("Authorization", "token-value");
xmlResquest.responseType = "blob";
xmlResquest.onload = function (oEvent) {
var content = xmlResquest.response;
var elink = document.createElement('a');
elink.download = "test.xlsx";
elink.style.display = 'none';
var blob = new Blob([content]);
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
document.body.removeChild(elink);
};
xmlResquest.send();
from
截存了 感谢分享
这个雪花的特效真好看#(脸红)
http://xiaowiba.com/archives/1043/
拿走了@(哈哈)