侠客请接刀
侠客请接刀
  • 发布:2015-12-02 14:33
  • 更新:2015-12-02 15:38
  • 阅读:1548

plus.webview.getWebviewByid每次都返回TypeError

分类:MUI

代码每次都返回TypeError: 'undefined' is not a function (evaluating 'plus.webview.getWebviewByid('url_'+item.module_code)')的错误,预加载失效??还是怎么回事

function bindClickEvent(item){
if (item.modulecode=="009001") {
mui.preload({
"id": 'url
'+item.module_code,
"url": item.module_url
});
console.log("预加载页面:"+item.module_url);
};
var li = document.getElementById("id"+item.module_code);
li.addEventListener('tap', function(event) {
plus.nativeUI.toast('你点击了模块:'+item.modulename);
alert('url
'+item.modulecode);
var modulePage = plus.webview.getWebviewByid('url
'+item.module_code);
alert(modulePage);
if (item.module_url) {
$.fire(modulePage, item.initfunction, null);
$.openWindow({
id: 'url
'+item.module_code,
show: {
aniShow: 'pop-in'
},
styles: {
popGesture: 'hide'
},
waiting: {
autoShow: false
}
});
}
}, false);
};

2015-12-02 14:33 负责人:无 分享
已邀请:
chender

chender - 与人为善

是getWebviewById不是getWebviewByid

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