【发布时间】:2021-12-26 15:38:23
【问题描述】:
使用 contentsync 插件,我正在从我的服务器下载 html。 文件已下载,我得到了保存路径等。
当尝试使用 jquery 将 html 加载到 div 中时,VKwebview 不允许加载 file://path_to_resource。没有错误,视图只是空白。
在 android 设备上,代码可以正常工作,所以我相当肯定它是 VKwebview
函数 startSync() {
var sync = ContentSync.sync({ src: imageZip, id: 'kittenZip' });
sync.on('progress', function(data) {
imageDiv.innerHTML = "<p>Syncing images: "+data.progress + "%</p>";
});
sync.on('complete', function(data) {
console.log(data.localPath);
$('#html_div').load("file://" + data.localPath + "/index.html")
}
});
sync.on('error', function(e) {
console.log('Error: ', e.message);
// e.message
});
sync.on('cancel', function() {
// triggered if event is cancelled
});
}
【问题讨论】: