Answer the question
In order to leave comments, you need to log in
Why doesn't Open API initialization work?
I'm trying to initialize the API like this:
VK.init({
apiId: 5213033
});
Uncaught TypeError: Cannot read property 'insertBefore' of undefined
Answer the question
In order to leave comments, you need to log in
It's simple: you have this code executed before the body tag is loaded , but should be executed after . For some reason, this was not taken into account in the documentation. So, change your code snippet to something like this
document.addEventListener("DOMContentLoaded", function () {
VK.init({
apiId: 5213033
});
});
Somehow a very small key for api. But the error is strange. In which file does it appear. Drop the code.
regardless of the application number - I have the following in the console:
at the same time - INITIALIZATION works fine, I think the "error" of the vk developers is not critical, and your code has nothing to do with the alarm in the console,
maybe you meant AUTHORIZATION?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question