<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
<script>
const requesturl = 'https://api.guthub.com/users/hiteshchoudhary'
const xhr = new XMLDocument();
xhr.open('GET',requesturl)
xhr.onreadystatechange = function () {
console.log(xhr.readyState); // checking the state
if(xhr.readyState === 4){
const data = JSON.parse(this.responseText)
console.log(data.followers);
}
}
xhr.send()
</script>
</html>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter