pennyoy
pennyoy
  • 发布:2015-06-18 10:42
  • 更新:2015-06-18 10:44
  • 阅读:1434

plus ready 问题

分类:HTML5+

下面代码运行时出现 "plus is not define"的错误,其中UserInfo的几个方法用到了plus.storage.setitem(),代码运行的时候有时候会出现plus is not define的错误,请问是什么原因呢
mui.plusReady(function(){

            document.getElementById('login').addEventListener('tap',function(e){  
                var username = document.getElementById('username');  
                var pwd = document.getElementById('userPwd');  
                mui.ajax('http://aaa.bbbb.net/communication/interface',  
                        {data:{  
                            actiontype:'open',  
                            username:username.value,  
                            pwd:pwd.value  
                        },  
                        dataType:'text',  
                        type:'post',  
                        timeout:5000,  
                        success:function(data){  
                            UserInfo.clear(); //清除登录状态信息  
                            UserInfo.username(username.value);----出错的地方  
                            UserInfo.password(pwd.value);----出错的地方  
                            UserInfo.token(data);----出错的地方  
                            console.log(UserInfo.username());  
                            console.log(UserInfo.password());  
                            console.log(UserInfo.token());  

                            mui.toast('登录成功!');  
                        }}  
                    )  
                })  
            })
2015-06-18 10:42 负责人:无 分享
已邀请:

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