1// Create a request variable and assign a new XMLHttpRequest object to it.
2var request = new XMLHttpRequest()
3
4// Open a new connection, using the GET request on the URL endpoint
5request.open('GET', url, true)
6
7request.onload = function () {
8 // Begin accessing JSON data here
9}
10
11// Send request
12request.send()