9***@qq.com
9***@qq.com
  • 发布:2019-07-24 20:21
  • 更新:2019-07-24 20:21
  • 阅读:755

getItem使用时addEventListener要用plusready但是我需要用tap怎么办?

分类:MUI
mui

当我点击提交按钮时可以执行ajax需要addEventListene的tap才能执行,如果在plusready状态下按钮无反应,但是我需要使用getItem获取setItem,求各位大神帮帮忙

document.addEventListener("plusready",plusReady,false);
var token = plus.storage.getItem("tokena");
【提交按钮事件】btnop.addEventListener("tap",function(){
mui.ajax('',{
headers: {
'access-token': token
},
data:{
'content':please
},
dataType:'json',//服务器返回json格式数据
type:'post',//HTTP请求类型
timeout:10000,//超时时间设置为10秒;
success:function(data){
alert("成功");
},
error:function(xhr,type,errorThrown){
alert("失敗");
}
});
},false);

2019-07-24 20:21 负责人:无 分享
已邀请:

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