• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Alert and setTimeout methods behaving differently in IE and Safari

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic