G
G
Gagatyn2017-07-12 21:14:45
JavaScript
Gagatyn, 2017-07-12 21:14:45

Error connecting open api vk?

Hello. Did everything by example, initialization and authorization.

<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <title>Test</title>
    <!-- <script src="https://vk.com/js/api/xd_connection.js?20" type="text/javascript"></script> -->
    <script src="https://vk.com/js/api/openapi.js?146" type="text/javascript"></script>
</head>
<body>
    <div id="res"></div>
    <script type="text/javascript" language="javascript">
    VK.init({
        apiId: ******
    });
    VK.Auth.login(response => {
        if (response.session) {
            console.log(True);
        } else {
            console.log(False);
        }
    })
    </script>
</body>
</html>

Displays in the console:
10b18b91e05b4336b71739826ac1295c.PNG
I do not understand how to solve. Tell

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Step, 2017-07-13
@kellas

In the VK application settings , domains / addresses from which you can send requests to api are registered.
put your host there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question