Most websites I see go in and over-explain how to grab data, eg. json, from an external website. This is a simple explanation of the SIMPLEST way to nab data.
This is going to go in and grab my gists from github and return the json data.What is giong on? Line-for-line:
1) Get the url we want to nab data from
2) instantiate the XMLHttpRequest object, which is used to go get and handle our data
3) the open method prepares our data to be retrieved and
4) the send method executes our prepared action
5) simply assigns the response message (If successful it will receive "ok")
6) Is the response. This is where all our json data from line 1 is stored.
7) Just outputs the data to our console.