Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
166
rated 0 times [  168] [ 2]  / answers: 1 / hits: 59723  / 13 Years ago, thu, september 1, 2011, 12:00:00

my code:



alert('Some message');


Question 1:



How to execute code that comes after alert() when user finished interacting with alert box?



Question 2:



How to detect if user pressed OK or Cancel on alert box ?


More From » jquery

 Answers
16

Question 1:



The alert method blocks execution until the user closes it:



alert('Some message');
alert('doing something else after the first alert is closed by the user');


Question 2:



use the confirm function:



if (confirm('Some message')) {
alert('Thanks for confirming');
} else {
alert('Why did you press cancel? You should have confirmed');
}

[#90304] Wednesday, August 31, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
austonjuancarlosb

Total Points: 238
Total Questions: 89
Total Answers: 99

Location: Chad
Member since Mon, Dec 5, 2022
1 Year ago
;