Results 1 to 4 of 4

Thread: javascript event

  1. #1
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default javascript event

    hi everybody

    i made page using asp to view some data from database. but i have problem with javascript. because that page must refresh every 20 secaonds (counter down) if there are some key storke or mouse event so timer must restart (become 20).

    can u help me?

  2. #2
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi

    Dont know if there are better ways to do it but this one works.

    In the HEAD tag put this
    ------------------------------------------------------------
    function LoadWindow() {
    window.open("PageName","_self");
    }
    </script>
    <script language="JavaScript">
    var timer=setTimeout("LoadWindow()",20000);
    </script>
    ------------------------------------------------------------
    Dont forget to put the PageName.

    If this is what you were looking for please say something back.

  3. #3
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default screen saver - event

    no. i know how to counter down timer. but i want make timer restart when mouse is moved or we press keyboard.
    (like sreen saver)

    thanks

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    See:

    http://www.quirksmode.org/js/events_compinfo.html

    example:
    Code:
    <script type="text/javascript">
    document.onmousedown=function(){alert('down')};
    document.onkeydown=function(){alert('down')};
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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