//第一步:页面获取登陆ID  
<div class="mui-content-padded">  
                <button class="mui-btn" id="enter">登录</button>  
                <button class="mui-btn" id="registered">注册</button>  
</div>  
//第二步:login.js路径:js/user/login.js  
//js获取登陆id增加点击事件  
document.getElementById("enter").addEventListener('tap',function(){  
    mui.openWindow({  
        url:'../../index.html',  
        id:'enterId',  
        //页面loaded事件发生后自动显示。默认为true!改为false  
        show:{  
            autoShow:false  
        },   
        waiting:{  
            autoShow:true,  
            title:'正在加载...'  
        }  
    });  
});  
//第三步:相同路径下创建index.js  
function plusReady() {  
    init();  
};  
if (window.plus) {  
    plusReady();  
} else {  
    document.addEventListener('plusready', plusReady, false);  
};  
function init(){  
    plus.nativeUI.closeWaiting();  
    plus.webview.getWebviewById("enterId").show();  
};  
点击登陆后报错信息:  
应用HBuilder已启动...  
 Uncaught TypeError: Cannot read property 'show' of undefined at js/user/index.js:11
求大神直接。。。多谢了!!!!!
            
            
            
            
4 个回复
BoredApe - 有问题就会有答案。
show的时候 enterId这个webview还没有创建
kedou (作者)
那要怎么做。。。
kedou (作者)
别的跳转页面也是这种方式写的。没问题啊!写这个登录就出现这个了
baiyaoqiang
求解决呀,Cannot read property 'webview' of undefined,呜呜