Created
April 20, 2017 14:22
-
-
Save jhonnymoreira/b0dc417cb61e83c5c395c27c8b2cfb8a to your computer and use it in GitHub Desktop.
A few JavaScript Patterns with opinionated code based on Stoyan Stefanov's book: JavaScript Patterns
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
const request = new XMLHttpRequest | |
const URL = 'https://google.com.br' | |
// `async` by default, since the last function param is ommited | |
request.open('GET', URL) | |
request.send() | |
// use `load` instead of `ready` so there is no need to do more checks | |
// related to status code and stuff | |
request.addEventListener('load', handleResponse) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment