Answer the question
In order to leave comments, you need to log in
How to make a java script function restart?
There is such a function that is launched when you click in the add-on, how to make it so that after clicking ana it starts, for example, every 3 seconds endlessly
activate: function() {
ProxyAddonBar.reset();
ProxyAddonBar.parseProxyList(function(ip_addr) {
var rand_proxy = ProxyAddonBar.randomProxy(ip_addr);
if(rand_proxy[3] == 'http')
{
ProxyAddonBar.connectTo(rand_proxy);
}
else
{
ProxyAddonBar.connectToSSL(rand_proxy);
}
document.getElementById('ip-address').children[0].value = ProxyAddonBar.getIPAddress();
ProxyAddonBar.proxyList = ip_addr;
ProxyAddonBar.addItemsToProxyList();
});
setTimeout("function()",5000);},
Answer the question
In order to leave comments, you need to log in
Instead of setTimeout, use setInterval
But only remember the interval ID so that you can stop later when the function is executed or completed successfully.
Yes, and you have the wrong call.
Need something like this:
var iv1;
function myInterrator() {
myobject.activate();
}
iv1= setInterval(myInterrator, 3000);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question