homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Detect Inactive Window
Detect Inactive Window

 6:26 pm on Sep 23, 2007 (gmt 0)

can somebody help me.. plaese..

i need to know when my window will be inactive... sample is browser window 1 and browser window 2, first window1 is active, and as i transfer to window 2 which the window2 will be active and the window1 is inactive, how do i detect that on java that window1 is inactive?

any answer will apprecieted... thanks you in advance...


JAB Creations

 3:20 am on Sep 24, 2007 (gmt 0)

You could probably try using window.onblur in conjunction with AJAX to send a signal to the server that the window has lost focus.


I would recommend using window.onblur in conjunction with a JavaScript timeout function. You'll have to determine how long is too long to loose the user's attention (IE they have left the computer or window while visiting a bank site and you wish to log them out if they fail to acknowledge that they are still present).

- John

[edited by: JAB_Creations at 3:21 am (utc) on Sep. 24, 2007]


 10:12 pm on Sep 27, 2007 (gmt 0)

thanks.. i will try some expirements.. :)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved