【发布时间】:2016-02-04 20:44:32
【问题描述】:
我在 Safari 浏览器 5x with windows 中遇到了这个问题:
'[object BlobConstructor]' is not a constructor (evaluating new Blob ([Myscript], { type: 'text/plain' })
这是我的代码:
var downloadLink = document.createElement("a");
downloadLink.download = fileNameToSaveAs;
downloadLink.innerHTML = "Download File";
if (window.webkitURL != null) {
downloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);
} else {
downloadLink.href = window.URL.createObjectURL(textFileAsBlob);
downloadLink.style.display = "none";
document.body.appendChild(downloadLink);
}
downloadLink.click();
$(downloadLink).parent().find(downloadLink).remove();
}
【问题讨论】:
标签: javascript safari blob