目录如下结构:
-css
- img
- js
- tpl
|-1.html
|-2.html
|-3.html
|-sub(子文件夹)
|-a.html
index.html---->入口文件
在入口文件index.html中使用plus.webview.create方法时,打开./tpl/sub/a.html时会无法打开,无什么呢?
目录如下结构:
-css
在入口文件index.html中使用plus.webview.create方法时,打开./tpl/sub/a.html时会无法打开,无什么呢?
把文件地址前面的../去掉
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<title>中旋网https://www.zzxxo.com</title>
<script type="text/javascript">
// H5 plus事件处理
function plusReady() {
// 创建并显示新窗口
var zxlmweb = plus.webview.create('tpl/sub/a.html');
zxlmweb.show(); // 显示窗口
}
if(window.plus) {
plusReady();
} else {
document.addEventListener('plusready', plusReady, false);
}
</script>
</head>
<body>
</body>
</html>
这是我的网站,O(∩_∩)O谢谢支持----->>中旋网zzxxo
king110 (作者)
谢谢!晚点试试看下
2017-08-07 15:43
阿楞先生
回复 king110:怎么样,我使用本地链接也是报错,上面去掉路径./也不行
2022-01-10 16:10