Created
September 22, 2011 04:25
-
-
Save yuppism/1234034 to your computer and use it in GitHub Desktop.
closureサンプルコード
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
var popopopoon = function() { | |
var nextId; | |
return function('引数') { | |
$.ajax({ | |
url:'', | |
data: { | |
hoge: nextId | |
} | |
success: function(data) { | |
//ここで、apiのレスポンスから次のapiに渡す値を取得 | |
nextId = data.nextId; | |
} | |
); | |
}; | |
}; | |
var readMore = popopopoon(); | |
readMore("引数"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment