I have the following api to fetch data from http://starlord.hackerearth.com/gamesarena I am trying to access the json there using the following piece of code:
<!DOCTYPE html>
<html>
<body>
<h2>Use the XMLHttpRequest to get the content of a file.</h2>
<p>The content is written in JSON format, and can easily be converted into a JavaScript object.</p>
<p id="demo"></p>
<script>
var requestURL = 'http://starlord.hackerearth.com/gamesarena';
var request = new XMLHttpRequest();
request.open('GET', requestURL);
request.responseType = 'json';
request.send();
var superHeroes = request.response;
console.log(request.response);
</script>
</body>
</html>
I expect to see JSON data,but get null.Can you explain what is missing