当我点击提交按钮时可以执行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);
0 个回复