Skip to content

Instantly share code, notes, and snippets.

@safe1981
Created March 9, 2012 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save safe1981/2006509 to your computer and use it in GitHub Desktop.
Save safe1981/2006509 to your computer and use it in GitHub Desktop.
Javascript: Asynchronous Recursion(jQuery)
// setTimeout 함수를 이용하여 반복적으로 함수실행시키기
(function(){
doStuff();
//arguments.callee는 자기 자신을 가리킴
//arguments.callee는 ECMAScript5 strict모드에서 depricated 되었음
setTimeout(arguments.callee,100);
})
//function에 이름주어서 해결하기
(function name(){
doStuff();
//arguments.callee는 자기 자신을 가리킴
//arguments.callee는 ECMAScript5 strict모드에서 depricated 되었음
setTimeout(name,100);
})
//ajax call방식에서 recursion수행하기
(function loopTest(){
doStuff();
$('#update').load('test.php', function(){
loopTest();
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment