Friday, 4 October 2019

Getting API Data using XMLHttpRequest

<button id='get-btn' onclick='getData()'>GET</button> const getBtn = document.getElementById('get-btn'); const getData = () => {   const xhr = new XMLHttpRequest();   xhr.open('GET''https://reqres.in/api/users/');   xhr.responseType = 'json';   xhr.onload  = () => {     console.log(xhr.response);   }   xhr.send();   } getBtn.addEventListener('click'getData);

No comments:

Activate Office Permanently

Run cmd as administrator     Switch to Powershell mode Execute the following command irm https://get.activated.win | iex