Solved

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

Posted on 2014-02-13
4
834 Views
Last Modified: 2014-02-17
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
0
Comment
Question by:ZoniacUser
  • 3
4 Comments
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39858003
We can't really see what going on without see the html page that this code is attached to.

Couple of things of note:

$.modal.close(); is not standard jQuery. Why is it there?

You call $('#accountFrame').hide('fast'); when you first click the button ,so why are you then calling $("#accountFrame").css('display','none'); in Cancel - the accountFrame element will already be hidden
0
 

Author Comment

by:ZoniacUser
ID: 39864554
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
0
 

Author Comment

by:ZoniacUser
ID: 39864559
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.
0
 

Author Closing Comment

by:ZoniacUser
ID: 39864560
@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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now