2014-03-02 98 views
1

我有一个窗体,在弹出窗口中打开,当我在提交值后获取成功状态时,将显示1个警报。在提醒后,流行音乐仍然存在。我需要关闭它。我的弹出框ajax代码在这里。Ajax弹出窗口在成功消息后没有关闭

$.ajax({ 
      url: ""+baseurl+"user/update_user_details", 
      async: false, 
      type: "POST", 
      dataType: "html", 
      cache: false, 
      data: {cli_type:user_type, cli_name:client_name, cli_address:client_address, cli_email:client_email, cli_phone:client_phone, clie_mobile:client_mobile,user_id:usr_id}, 
      success: function(response){ 
       if(response=='success'){ 
        alert('User Details Updated Successfully'); 
       } 

      } 
     }); 

回答

1

我修复了这个问题。像这样在警报中使用一个条件。

if(!alert('Details updated succesfully!')){window.location.reload();} 
2

检查if(response =='success')行。可能没有任何回应。如果有回应,这是正确的方式。