开发中碰到一个问题,在页面添加子webview(第三方网址),并加载js,加载的js中需要使用另一个公用的webview(本地模板文件),第一次进入可以,但是返回,再次进入时页面无法加载,提示“无法找到该页”。
请问用appendJsFile加载的js中怎么创建本地webview?
部分代码:
html:
embed = plus.webview.create("http://www.baidu.com","sub-travel",{top:subPageTop,bottom:'0px'});
embed.appendJsFile("_www/js/mui.min.js");
embed.appendJsFile("_www/js/travel.js");
plus.webview.currentWebview().append( embed );
travel.js
if(!plus.webview.getWebviewById("detail")){
detailPage = plus.webview.create("detail.html","detail",{top: 0, bottom: 0});
}else{
detailPage = plus.webview.getWebviewById('detail');
}
GETONE (作者)
谢谢,我试试
2015-07-10 10:14