0

I had this jquery idle timeout script implemented into a site, thanks to ehynds for the great job.

Everything is working fine except below part:

onTimeout: function(){
    window.location = "timeout.htm";
},

There is another function which will handle the logout process in the same page, I want the onTimeout will trigger a logout function when the timer is reached, which is like below:

onTimeout: function(){
   // call a logout function here;
},

How can I call the function load inside onTimeout block?

1

2 Answers 2

1

you can find the control whose event you want to trigger.

onTimeout: function(){
    $('#foo').trigger('click');
}

or You can call function staightway.

onTimeout: function(){
    SomeFunction();      
}
Sign up to request clarification or add additional context in comments.

Comments

0

If the plugin works as it looks like it should - what you pasted is the function you are looking for. If you want to call a seperate function:

onTimeout: function(){
    anotherFunction();
},

but any code inside there should be called if the plugin is functioning correctly. Test like so:

onTimeout: function(){
    alert('i will put my logout function here');
},

if you dont get an alert dialog after the timeout period.. i would say its a problem with the plugin.

2 Comments

the alert dialog can show up, how can I call a function in it??
onTimeout: function(){ anotherFunction(); },

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.