GETONE
GETONE
  • 发布:2015-07-08 12:26
  • 更新:2015-07-09 20:00
  • 阅读:2640

用appendJsFile加载的js中怎么创建webview?

分类:MUI

开发中碰到一个问题,在页面添加子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');  
}
2015-07-08 12:26 负责人:无 分享
已邀请:
DCloud_UNI_FXY

DCloud_UNI_FXY

你这种情况,在webview.create的时候,也要加上_www前缀
  • GETONE (作者)

    谢谢,我试试

    2015-07-10 10:14

该问题目前已经被锁定, 无法添加新回复