A
A
Alexander Ivanov2016-03-09 17:20:08
HTML
Alexander Ivanov, 2016-03-09 17:20:08

What am I doing wrong when inserting a button from VK?

The task is simple, but it takes too much time.
So I put in this button.

<script type="text/javascript" src="//vk.com/js/api/openapi.js?121"></script>

<script type="text/javascript">
  VK.init({apiId: 3863218, onlyWidgets: true});
</script>
</head>
<body>

<script type="text/javascript">
  VK.init({apiId: 3863218, onlyWidgets: true});
</script>

<!-- Put this div tag to the place, where the Like block will be -->
<div id="vk_like"></div>
<script type="text/javascript">
VK.Widgets.Like("vk_like", {type: "full", verb: 1});
</script>

And she does not plow into any xn--7-ftbt.xn--p1ai (in the upper left corner)
So I also tried:
<script type="text/javascript" src="//vk.com/js/api/openapi.js?121"></script>

<script type="text/javascript">
  VK.init({apiId: 3863218, onlyWidgets: true});
</script>
</head>
<body>

<!-- Put this div tag to the place, where the Like block will be -->
<div id="vk_like"></div>
<script type="text/javascript">
VK.Widgets.Like("vk_like", {type: "full", verb: 1});
</script>

It is curious that there are quite a lot of these buttons throughout the network, and why VK has the most problematic and crooked solution.
In general, on this page you need to configure. https://vk.com/editapp?id=3863218§ion=options
Instead 3863218 - enter your ID

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Almaz Bisenbaev, 2016-03-09
@cimonlebedev

In my opinion, this part should be inserted into<head></head>

<script type="text/javascript" src="//vk.com/js/api/openapi.js?121"></script>

<script type="text/javascript">
  VK.init({apiId: 3863218, onlyWidgets: true});
</script>
</head>
<body>

<script type="text/javascript">
  VK.init({apiId: 3863218, onlyWidgets: true});
</script>

S
Sergey Goryachev, 2016-03-09
@webirus

Everything is written there. "Invalid application domain.".
Most likely, you did not enter the domain when you received the key, or entered it with an error, or entered it and did not save it.
There are a lot of options, dig the section for developers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question