Bmob.initialize("6b4140fafe82ea45c3a2111f6447f5cc","109bb0d6635e1ac9e58d6e3220cfa38c"); var Users=Bmob.Object.extend("Users"); var user=$(".user").val(); var email=$(".email").val(); var panduan=0; $(".submit1").click(function() { panduan=1; alert(panduan); /*alert(user);*/ var users=new Users(); users.set("name",user); users.set("email",email); users.save(null,{ success:function(users){ alert(email); $(".showup").html(user+" "+email); alert('添加数据成功,返回的objectId是:'+users.id); }, error:function(users,error){ alert('添加数据失败,返回错误信息:' + error.description); } })我想在.submit1的click事件后才添加数据,为什么不成功呢,去掉那个click事件就成功了,为什么啊?
添加回答
举报
0/150
提交
取消