0

Can I do this to increase the time:

delay(10000*10)
7
  • what do you need to do exactly, regardless of the ability to get this peace of code to work. Commented Mar 29, 2011 at 13:26
  • Have you tried it? Is it not working for you? Commented Mar 29, 2011 at 13:26
  • Please clarify; there is no function called delay() in javascript. If it's user defined, I suppose you can just add another zero to either number? Commented Mar 29, 2011 at 13:27
  • @Andre ~ .delay() is a jQuery function. :) Commented Mar 29, 2011 at 13:28
  • well I want to increase the delay time, but it doesn't seem to work. Commented Mar 29, 2011 at 13:36

2 Answers 2

3

why not just try it :)
http://jsfiddle.net/utj6h/

Sign up to request clarification or add additional context in comments.

Comments

0

Sure, assuming you are using some type of function that handles the delay I use something similar to the following (to set a Refresh Rate, which is stored in the Session):

setInterval(function ()
{
    var grid = $('#GridName').data('tGrid');
    grid.ajaxRequest();
}, <%= int.Parse(Session["RefreshRate"].ToString())*1000 %>);

so for your usage:

setInterval(function ()
{
    //Refresh logic

}, (10000*10)); //Your delay goes here

Delay function:

var delay = (function(){
        var timer = 0;
        return function(callback, ms){
        clearTimeout (timer);
        timer = setTimeout(callback, ms);
    };
    })();

Edit: Totally neglected the jQuery delay() function, which should be working as you have written. If not, it may not like the calculation inside the argument and you could try:

var delay = 10000*10;

.delay(delay)

Comments

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.