Created
January 6, 2014 11:36
-
-
Save christian-fei/8281582 to your computer and use it in GitHub Desktop.
Hey Kevin, I read you post about jekyll and bullgit. You mentioned you got the response twice when doing the xmlhttprequest.
It may be because your are not 'waiting long enough'. Maybe (certainly) the code below explains it better
This file contains hidden or 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 xml = new XMLHttpRequest(); | |
//async, coz Ajax | |
xml.open("GET", "https://api.github.com/orgs/bullgit/repos", true); | |
xml.onreadystatechange = function() { | |
//see this link for more info about readyState http://www.w3schools.com/ajax/ajax_xmlhttprequest_onreadystatechange.asp | |
if (xml.status==200 && xml.readyState==4){ | |
//your code | |
} | |
}; | |
xml.send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment