I can’t get access to Xios

Asked

Viewed 296 times

1

I am using Axios by Cdn and error appears: "Uncaught Error: URL contains XSS Injection Attempt"

The Javascript code of the main_axios.js file

axios.get('https://api.github.com/users/diego3g')
    .then(function(response){
        console.log(response);
    })
    .catch(function(error){
        console.warn(error);
    });

THE HTML

<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script src='https://unpkg.com/axios/dist/axios.min.js'></script>
    <script src='main_axios.js'></script>
</body>
</html>
  • Is that all the code you’re using? I just tested it and it’s working

  • I don’t know what’s going on. In the folder where are the 2 files "C: Users User Documents Programming Asynchronous" the error happens, but I just tested creating other 2 files with the same code on the desktop and they worked.

  • If you are running without a server?

  • No, it’s just these two files

  • I changed the name of the folder "Javascript" to anything else that worked normal

  • Gustavo, I had the same problem. Use version 0.18 of Axios, the 0.19 is not working.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.