homepage Welcome to WebmasterWorld Guest from 54.198.148.191
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
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
camilord




msg:3458710
 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




msg:3458931
 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.

*edit*

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]

camilord




msg:3463221
 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved