Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Posts
    144
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Another Re-Direct Question

    Hi Guys,

    Is this possible.

    If a page is opened and no action is taken on the page, but left open for maybe 5 min can it be re-directed to another page BUT if the page has been scrolled inside the 5 min then no action to take place. Maybe the time be reset from the last action on the page.

    I hope I have made that clear.

    Regards,

    The Dingbat

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Is the scrolling the only thing you want to be monitored. How about mouse moves, clicks and keypresses?

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Posts
    144
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Yes, all keyboard & mouse moves. Just to reset the time and then redirect

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Tested in IE6, NS7, Moz1
    Redirect time is set to 10 secs only for demo purposes.
    Timer display is added for tracking purposes only.
    Attached Files Attached Files

  • #5
    Regular Coder
    Join Date
    Oct 2002
    Posts
    144
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Hi Glenn,

    I have downloaded the script and it works great except for one small problem.

    In the script you have created an eliment id name clock and in the body a span item that calls the clock id. I have tried everything to remove that id but have failed. Can you please direct me to the correct amendment.

    Regards,

    The Dingbat

  • #6
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not Glenn but that is easy to change.

    Change both instances of this:
    Code:
        //for tracking only
        clearInterval(timerClock);
        document.getElementById("clock").innerHTML="0";
        timerClock=setInterval("document.getElementById('clock').innerHTML=parseInt(document.getElementById('clock').innerHTML,10)+1",1000);
        //end tracking
    With this:
    Code:
        //for tracking only
        clearInterval(timerClock);
        clock = 0;
        timerClock=setInterval("(clock+1)",1000);
        //end tracking
    And remove the span.

    .....Willy

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    What's the use of the clock variable?

    I think Dingbat doesn't want the timer clock. As I've mentioned, I put it for tracking/debugging purposes only. They should be removed in the actual code.

    - Remove timerClock declaration
    var xScroll, yScroll, timerPoll, timerRedirect, timerClock;

    - Remove 2 instances of this:
    //for tracking only
    clearInterval(timerClock);
    document.getElementById("clock").innerHTML="0";
    timerClock=setInterval("document.getElementById('clock').innerHTML=parseInt(document.getElementById( 'clock').innerHTML,10)+1",1000);
    //end tracking

    - Remove span
    Time: <span id="clock" style="font-weight:bold">0</span>

  • #8
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I didn't see a need to remove the tracking and felt it would be handy to have in the event I would want to use the script myself in the future and needed to check if it was working.

    FWIW: This bookmarklet can be used to return the clock variable value


    javascript&#58;var globalvar=prompt('Read which variable?','');if(globalvar)try{alert(globalvar+' = '+eval(globalvar)+' ('+typeof(eval(globalvar))+')');}catch(e){alert('Global variable \''+globalvar+'\' does not exist.');}


    .....Willy

    Edit: Tried to fix the line break in the bookmarklet.
    Last edited by Willy Duitt; 02-20-2004 at 05:01 AM.

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Originally posted by Willy Duitt
    I didn't see a need to remove the tracking and felt it would be handy to have in the event I would want to use the script myself in the future and needed to check if it was working.
    .....Willy
    You are talking from the point of view of the web developer not the end-user. You even posted a bookmarklet to check a global variable. What I was talking about was when the application is deployed, the tracking script block should be removed if not needed.

  • #10
    Regular Coder
    Join Date
    Oct 2002
    Posts
    144
    Thanks
    12
    Thanked 0 Times in 0 Posts
    To Glenn & Willy,

    My thanks to you guys. The script is now working as I wanted in the first place. Your assistance is very much appreciated.

    With kindest regards,

    The Dingbat

  • #11
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I don't know that anyone still looks at these older threads, but I have a question about the idledetect.htm page. When I found that, I thought it was the answer to what I had been struggling with. However, I have one problem, the page that I am trying to detect idle time on is one that will be contained inside an iframe (it is a .exe 'page' that is used for secure stuff at a school) and the idle detection does not work inside the iframe. Any suggestions?

    Thanks a million!

  • #12
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Can you elaborate on your problem? Do you want to make the script working in both the main page and the iframe or in the iframe only?

    If in the iframe only, just put the script inside the iframe page. And if you want to redirect the page to the main window and not to the iframe, then you need to change the redirect line to:

    Code:
    timerRedirect = setInterval("parent.location.href='anotherpage.htm'",10000); //set timed redirect
    You can also use top instead of parent if you want to open in the outermost window and you have nested frames.

    If you need to idle detect in both the main page and iframe, the script needs to be modified further.

    Let me know what you need.

  • Users who have thanked glenngv for this post:

    froglander (04-01-2008)

  • #13
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Some of the pages that I want to detect idle time are ones that I am not able to modify. They are contained on a secure server and it is a .exe file that does things like student registration. What I am trying to do is get rid of a popup window that serves as a warning to students to remember to logout.

    The main problem is that some of the student toolbox pages that I want to detect idle time on are generated by a file called "rqserver.exe" that I have no access to. I was trying to locate the pages generated by this application inside an iframe so that I could display the warning depending on idle time. I don't have to worry about a session time out, just a local, client-based redirect based on idle time.

    Thanks so much for your help!

  • #14
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Are the main page and the iframe page in the same domain? If they are, there could be a solution.

  • #15
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Yes, as far as I can tell, all the pages are in the same domain.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •