wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Alert and setTimeout methods behaving differently in IE and Safari Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Alert and setTimeout methods behaving differently in IE and Safari" Watch "Alert and setTimeout methods behaving differently in IE and Safari" New topic
Author

Alert and setTimeout methods behaving differently in IE and Safari

Senguttuvan Paramasivam
Greenhorn

Joined: Feb 20, 2010
Posts: 7
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?
 
 
subject: Alert and setTimeout methods behaving differently in IE and Safari
 
Similar Threads
Notify Users before session expires
Alert user before session timeout
session timeout using javascript
AJAX Hangs Apache
Where to invoke AJAX code to ask user if they want to extend session?