Link to home
Start Free TrialLog in
Avatar of ZoniacUser
ZoniacUser

asked on

Safari : Alert Message Not Closed when next alert Message Opens Using Jquery?

0 down vote favorite
      

In Safari Browser having one issue, following are my scenarios (with Example).

When i Click a button for delete an account on that time i opens alert message. in that alert window having two actions "OK" and "Cancel". if i click Yes it will redirect to another URL.(This is No Problem). But When i click "Cancel", i triggering to open another alert window. on that time previous alert not getting closed.

In Other Browsers like I.E, Firefox, Chrome it working fine.

Below is my Coding....

$('#upgradeNo').click(function(){ // Function
$('#accountFrame').hide('fast'); // To close the alert window( First alert)
$.modal.close(); // To close the alert window( First alert)
if( $("#deleteconf").val()=="ok"){ // Click Yes Button Function
    deleteAcc();
}else{ // Click Cancel Button Function
    $("#accountFrame").css('display','none');
deactivateAccount(); // new Alert gets open in this place
}
$("#deleteconf").val('');   

});

Open in new window


Can anybody give me a quick solution. Awaiting for Response.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ZoniacUser
ZoniacUser

ASKER

i Got a Solution. i put the code in Modal Window OnClose Event. after that i called alert box. Now its working Fine , what i Expecting.    

            onClose: function (dialog) {
                dialog.container.fadeOut(100, function () {
                dialog.overlay.fadeOut(200, function(){
                    $.modal.close();

                    if (deactivateFlag)
                        {
                    deactivateAccount();
                        }
                });
                });
            }

Open in new window


Thanks
I've requested that this question be closed as follows:

Accepted answer: 0 points for ZoniacUser's comment #a39864554

for the following reason:

I Got a solution from google with my scenarios. First i closed my modal window and then called alert box. thats it.
@Chris Stanyon Thanks for Your Comment. Yes Modal.close is the valid syntax for Closing modal window. i have search and found the solution with myself did some workout. i have added the solution above.