posted 12 years ago
I am facing an issue with Safari when I execute the following code. Please help me to resolve the same.
In the following code, I just want to check the user age. If it is greater than 60 then I am alerting the user. Also in the background, I just want to call a timeout() method, using setTimeout() javascript function,for every 15 seconds when a mouse is clicked or a key is pressed.
The problem is that the below code is executing fine in IE. However, it is not executing in Safari.
In IE, when I enter the age value 62 and presses the button, I am getting an alert message. After 15 seconds, I am getting another alert message from timeout() method.
In Safari, When I enter the age value 62 and presses the button, I am getting an alert message. Immediately, I am getting another alert message from timeout() method.
The code is below:
Why the same code is behaving differently in Safari?