Created
March 9, 2012 13:30
-
-
Save safe1981/2006509 to your computer and use it in GitHub Desktop.
Javascript: Asynchronous Recursion(jQuery)
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
// 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