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', 'https://ghibliapi.herokuapp.com/films', true)
6
7request.onload = function () {
8 // Begin accessing JSON data here
9}
10
11// Send request
12request.send()
1$.getJSON(
2 "API URL HERE",
3 function (data){
4 console.log(data); // by printing to the console you can easely check all values in the console
5 //every api related code here...
6 }