Solved

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

Posted on 2014-02-13
4
839 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Rotate images for Web Page 11 28
Jquery if else not working ... WHY? 5 26
How to show popup no matter what a user clicks on navigation wise 10 35
toggle content 12 25
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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…

726 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