V
V
Vladimir Tatarnikov2016-04-12 14:03:51
Classmates
Vladimir Tatarnikov, 2016-04-12 14:03:51

Do I need to initialize oksdk.js before each method call?

The problem is this. I have never worked with JavaScript, I am learning on tasks. I use your toolkit from the github page. When I need to get once information about whether the current user has put a class on the photo, then this is not a problem. And when I want to poll this case in a loop, then my server just hangs when oksdk is initialized. I don’t fully understand how to work with init and method calls. Like every time before calling the method I have to initialize OK?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vjacheslav Kanivetc, 2016-04-12
@Termvsrobo

You need to initialize ok-js-sdk every time the page is reloaded.
That is, if the code simply works in a loop and sends 20 requests, it makes no sense to initialize for each. But if you have several pages between which navigation takes place, then on each such page there must be initialization (and the necessary parameters must be passed)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question