This is the code I am using to do so.
This code, appears in the documentation, but I'm probably using it wrong, since I'm getting no output.
<script type="text/javascript" src="/js/script.js"></script>
var xhttp = new XMLHttpRequest();
xhttp.open("GET", 'https://euw.api.pvp.net/api/lol/euw/v1.4/summoner/by-name/{name}?api_key={key}',true);
xhttp.send();
document.write(xhttp.responseText);
</script>
My aim is to get JSON code in respond from the API, and be able to operate with it.
In this case I'm trying to show the code obtained from the api and show it in the page.
Thanks in advance.