KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How can I build a webpage which is able to monitor when the page gets the focus, especially when Safari is in the background and the user switches Safari back to the foreground. The code below does not fire the event when switching to Safari on an iPhone <html> <head> <script type="text/javascript"> window.onfocus = function() { alert("onfocus"); }; </script> </head> <body> Main text </body> </html> According http://www.quirksmode.org/dom/events/index.html : Safari iPhone does not fire the event when the window gains the focus. So my question is still: how to detect by using Javascript on a web page within Safari for iPhone that the window receives the focus?
Tags (comma-separated)
Save Edits
Cancel