J
J
jackie chan2015-11-06 20:38:00
JavaScript
jackie chan, 2015-11-06 20:38:00

How to make setinterval every 10 seconds?

how to attach setinterval to this?

<script type="text/javascript">
    VK.init({
        apiId: 5135424
    });
VK.Api.call('status.get', {}, function(r) { 
  if(r.response) { 
    $('#statusjs').append(''+r.response.text+'') 
  } 
});
</script>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
wol_fi, 2015-11-06
@onvorobyov

var interval = setInterval(function(){
VK.Api.call('status.get', {}, function(r) { 
  if(r.response) { 
    $('#statusjs').append(''+r.response.text+'') 
   //если надо остановить
     if(stop){
        clearInterval(interval);
     }
  } 
});
}, 10000);

Something like this

S
Sergey, 2015-11-06
Protko @Fesor

https://developer.mozilla.org/en-US/docs/Web/API/W...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question