[英]XMLHttpRequest with a file from a 3rd party server
首先,請原諒我的英語。
是否可以使用帶有url參數的xmlhttp GET請求檢索文件,該參數是不在服務器中但在另一台服務器中的文件的地址?
<script>
var request = new XMLHttpRequest();
request.open("GET", "url/of/file.epub", true);
request.responseType = "blob";
request.onload = function () {
new Epub(request.response, function (bookData) {
Monocle.Reader("reader", bookData);
});
};
request.send();
</script>
在上面的示例中,使用XMLHttpRequest返回blob
如果您因為嘗試在電子書中進行此操作而標記了此“ epub”,那么您就不走運了。 XMLHttpRequest
根本不起作用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.