Last active
December 31, 2015 20:09
-
-
Save assada/f4c92c48581d2b7af6ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function myLoop (i) { | |
setTimeout(function () { | |
var xmlhttp = new XMLHttpRequest(); | |
xmlhttp.open('GET', 'http://xjedi.com/forum/index.php?act=rep&type=add&mid='+i+'&message=Happy%20New%20Year!', true); | |
xmlhttp.onreadystatechange = function() { | |
if (xmlhttp.readyState == 4) { | |
if(xmlhttp.status == 200) { | |
clearTimeout(timeout); | |
console.info('User #'+i+' +'); | |
} | |
} | |
}; | |
xmlhttp.send(null); | |
var timeout = setTimeout( function(){ xmlhttp.abort(); console.log("Time over") }, 10000); | |
if (--i) myLoop(i); | |
}, 1000); | |
})(45370); //maxId |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Что это?
Ставим плюсики всем пользователям xjedi.com. Особенно полезно на Новый Год!
Как использовать
Автор: Starboy