Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7672017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:11:22+00:00 2026-05-31T16:11:22+00:00

I am working with session timeout in javascript. I use this code for the

  • 0

I am working with session timeout in javascript.

I use this code for the timeout in my .js file:

var wintimeout;  
    function SetWinTimeout() {  
         intimeout = window.setTimeout("redirect();",g_secTimeout); //after 5 secs i.e. 5 * 1000  
    }   

      //$('body').click(function() {
      jQuery('body').click(function() {
        window.clearTimeout(wintimeout); //when user clicks remove timeout and reset it  
        SetWinTimeout();  
    });  

});

In my .php file I included the jquery source:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
 <!--script type="text/javascript" src="../js/jquery.alerts-1.1/jquery.js"></script-->

I tried both of this..

But when I run it it still gives me the ‘$ is undefined’ or ‘jQuery is undefined’ error for IE and FF.

Aside from jquery I am using the prototype library. In my other pages, it is working
which is also using jquery and protoype. But for these other pages it keeps giving me this error.
It gets really frustrating ;(

Can somebody help!

If this should matter:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtm11/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:11:23+00:00Added an answer on May 31, 2026 at 4:11 pm

    Strip a copy of your page down to the bare minimum; nothing in the <body>, just <script src="path/to/jquery.js"> in the plus the following inside its own <script></script> tags:

    jQuery(function(){
        var wintimeout;
        function redirect(){
            alert('REDIRECT');
        }
        jQuery('body').click(function() {
            clearTimeout(wintimeout);
            wintimeout = setTimeout(redirect, 5000);
        });
    });
    

    If it still gives the same error, then it must be the path to the jQuery file; correct the path.

    Once that’s working, build the page up again by adding HTML, CSS and other javascript back in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a ASP.Net 3.5 project and trying to implement session timeout
The application I'm working on at the moment has a session timeout value. If
I'm trying to adjust the session timeout using HttpSession.setMaxInactiveInterval and it's not working. Here
I am currently working on session timeout. During inactivity in my page for a
In my Grails app I use session.invalidate() to deal with a timeout. When a
When working an interactive bash session, one aspect from the Windows shell I miss
Session variables are apparently not working for me. I don't know what I'm doing
I'm working on a long string grabbed from a Session that uses § (Section
I'm working on a site that has a requirement to share session between a
Without routing, HttpContext.Current.Session is there so I know that the StateServer is working. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.