?
Solved

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

Posted on 2014-02-13
4
Medium Priority
?
848 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 1000 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

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn how to dynamically set the form action using jQuery.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
Suggested Courses

800 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