문제

I have a form which opens in a popup and when I submit values in that after getting success status it will show 1 alert. After alert the pop is still there. I need to close it. My popup box ajax code is here.

$.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');
                 }

            }
         });
도움이 되었습니까?

해결책 2

I have fixed the issue. Used one condition in alert like this.

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

다른 팁

Check on if(response=='success') line. There may be no response is getting. If there is a response it is the right way.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top