Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Location
    Bangalore, India
    Posts
    175
    Answers
    4
    Vote Rating
    2
    renganathan is on a distinguished road

      0  

    Default Answered: How to make ajax call for every 5 seconds?

    Answered: How to make ajax call for every 5 seconds?


    Hi All,

    I want to make ajax call for every 5 seconds.

    Can you guys suggest me how to do that ?
    Thanks,

    RENGANATHAN M G

  2. You could use Ext.util.DelayedTask

    Example

    Code:
            this.pollTask = new Ext.util.DelayedTask(function(){
                Ext.Ajax.request({
                    url: pollUrl,
                    scope: this,
                    success: function(r) {
                    },
                    failure: function() {
                    }
                });
                this.pollTask.delay(5000);
            }, this);
    
    
            this.pollTask.delay(5000);

  3. #2
    Sencha User wojteks27's Avatar
    Join Date
    Aug 2011
    Location
    Kraków, Poland
    Posts
    30
    Answers
    3
    Vote Rating
    2
    wojteks27 is on a distinguished road

      0  

    Default Interval

    Interval


    Use this :
    Code:
    //we store setInterval's return value in case we want to clear the interval later on with clearInterval(myInterval)
    var myInterval = setInterval(function() {
    //here you put your AJAX request
    }, 5000//5 seconds in ms);
    PS.
    of course if it is what you were looking for and I understood you correctly

  4. #3
    Sencha Premium Member
    Join Date
    Feb 2010
    Location
    Chicago
    Posts
    34
    Answers
    10
    Vote Rating
    8
    Johnny Major will become famous soon enough

      0  

    Default


    You could use Ext.util.DelayedTask

    Example

    Code:
            this.pollTask = new Ext.util.DelayedTask(function(){
                Ext.Ajax.request({
                    url: pollUrl,
                    scope: this,
                    success: function(r) {
                    },
                    failure: function() {
                    }
                });
                this.pollTask.delay(5000);
            }, this);
    
    
            this.pollTask.delay(5000);

  5. #4
    Sencha User wojteks27's Avatar
    Join Date
    Aug 2011
    Location
    Kraków, Poland
    Posts
    30
    Answers
    3
    Vote Rating
    2
    wojteks27 is on a distinguished road

      0  

    Default Ext.TaskManager

    Ext.TaskManager


    According to Sencha docs here : http://docs.sencha.com/core/manual/content/timers.html, the correct way would be to use Ext.TaskManager.

    Still I wonder why is it advised to use this solution instead of basic setInterval.
    Can anyone explain?

  6. #5
    Sencha User
    Join Date
    Jun 2011
    Location
    Bangalore, India
    Posts
    175
    Answers
    4
    Vote Rating
    2
    renganathan is on a distinguished road

      0  

    Default


    Thanks All for your solution
    Thanks,

    RENGANATHAN M G

Thread Participants: 2

Tags for this Thread