当用户点击登录或注册按钮时,我试图阻止多个请求。这是我的代码,但它不起作用。只是第一次工作正常,然后返回false..$('#do-login').click(function(e){e.preventDefault();if($(this).data('requestRunning')){return;}$(this).data('requestRunning',true);$.ajax({type:"POST",url:"/php/auth/login.php",data:$("#login-form").serialize(),success:function(msg){//st
当用户点击登录或注册按钮时,我试图阻止多个请求。这是我的代码,但它不起作用。只是第一次工作正常,然后返回false..$('#do-login').click(function(e){e.preventDefault();if($(this).data('requestRunning')){return;}$(this).data('requestRunning',true);$.ajax({type:"POST",url:"/php/auth/login.php",data:$("#login-form").serialize(),success:function(msg){//st