I have a problem with the following code where the answer is this:
As you can see there is an answer but I get that error and it does not load me. Thanks in advance!
window.onload = function() {
var mb = document.getElementById("myBtn");
mb.addEventListener("click", jsonparser1);
}
function jsonparser1() {
$.ajax({
type: "GET",
url: "https://euw1.api.riotgames.com/lol/summoner/v3/summoners/by-name/kappaequiscu1v9?api_key=RGAPI-9536b7c8-f23f-40a9-aea5-7a5bcd879205",
dataType: "JSONP",
success: function (xhr) {
var response = JSON.parse(xhr.responseText);
document.getElementById("span").innerText = response.accountId;
}
});
}
<!DOCTYPE html>
<html>
<head>
<title>DSFSF</title>
</head>
<body>
<h2>API KAPPAEQUISCU</h2>
<h3>Search:</h3>
<!--<input type="text" id="summoner">-->
<input type="submit" id="myBtn">
<h3>Response:</h3>
<span id="span"></span>
<span id="spanDos"></span>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="java.js"></script>
</body>
</html>