League of Legend API with javascript

0
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>



        var api_kei = "secreto";
        var request = new XMLHttpRequest();
        var url = "https://na1.api.riotgames.com/lol/summoner/v3/summoners/by-name/RiotSchmick?api_key="+api_kei;

        request.open('GET',url,true);

        request.onload = function () {

        }

        request.send();

    </script>

</body>

</html>
  

The Error output you give me is this:

>Solicitud de origen cruzado bloqueada: La misma política de origen no permite la lectura de recursos remotos en https://na1.api.riotgames.com/lol/summoner/v3/summoners/by-name/RiotSchmick?api_key=secreto. (Razón: Solicitud CORS sin éxito).[Saber más]
    
asked by josanangel 25.09.2018 в 21:27
source

0 answers