Answer the question
In order to leave comments, you need to log in
How to initialize api classmates?
Using the following code:
<script type="text/javascript" src="//api.ok.ru/js/fapi5.js" defer="defer"></script>
var rParams = FAPI.Util.getRequestParameters();
FAPI.init(rParams["api_server"], rParams["apiconnection"],
/*
* Первый параметр:
* функция, которая будет вызвана после успешной инициализации.
*/
function() {
alert("Инициализация прошла успешно");
// здесь можно вызывать методы API
},
/*
* Второй параметр:
* функция, которая будет вызвана, если инициализация не удалась.
*/
function(error) {
alert("Ошибка инициализации");
}
);
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://test.ru') does not match the recipient window's origin ('http://test.ru').
Answer the question
In order to leave comments, you need to log in
Look at the example https://github.com/apiok/ok-js-sdk/blob/master/sam... (not FAPI5 is used here, but a slightly newer version of the SDK, but the principle is the same)
And there is not enough data for the request itself to understand the cause of the error. If it doesn’t work out, then it would be right to make an example on github (gh-pages branch) with which the problem repeats so that you can see it
It seems to me that the problem is with the protocol: http and https, not sure
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question