Created
August 28, 2016 19:52
-
-
Save seth10/870c5eb792f6ddde1e2db6db22ab7690 to your computer and use it in GitHub Desktop.
Use the current chapter number in the callback with let to keep the value at that time
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
for(var n = 1; n <= fic_info['max_chapters']; n++) { | |
let n_ = n; | |
getChapter(fic_info['url']+n, function(page) { | |
(chrome.extension.getBackgroundPage()).addChapter(page, n_, fic_info['max_chapters']); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment