请问Bob,在使用URL.createObjectURL(blob);上经常会出现closeError错误,这种情况是属于什么错误呢?
var that = this;
console.log("下载图片");
try
{
var url = img_url;
if (url)
{
client = new XMLHttpRequest();
if (client)
{
client.open("GET", url, true);
client.responseType = "blob";
client.onreadystatechange = function ()
{
if (client.readyState === 4)
{
if (client.status !== 200)
{
// 下载失败
console.log("Unable to download blob - status code: " + client.status.toString());
}
else
{
// 请求下载成功
var content_length = client.getResponseHeader("Content-Length");
var blob = client.response;
var format_url = URL.createObjectURL(blob);
console.log("请求下载成功")
that.__create_file(blob, img_file_name, function ()
{
callback.call(this, format_url);
});
}
}
}
client.send(null);
}
}
}
catch (e)
{
//
}