我正在旧手机中使用cordova示例代码(Samsung GT-N7100 android 4.1.1,API 16)。
var blob = new Blob([this.response], { type: 'image/png' });
以上行代码会将错误报告为: E / Web控制台:未捕获的TypeError:非法构造函数:175
虽然它在模拟器(Android 6.0,API 23)中运行良好。
我的问题:哪个android API版本的cordova文件插件支持?我在哪里可以找到cordova的功能期望支持的所有平台版本?
代码及其来源网站位于: http://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html#write-to-a-file-
function getSampleFile(dirEntry) {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://cordova.apache.org/static/img/cordova_bot.png', true);
xhr.responseType = 'blob';
xhr.onload = function() {
if (this.status == 200) {
var blob = new Blob([this.response], { type: 'image/png' });
saveFile(dirEntry, blob, "downloadedImage.png");
}
};
xhr.send();
}