Return JavaScript value from a callback

  • Автор темы Автор темы Maddo7
  • Дата начала Дата начала

Maddo7

Client
Регистрация
09.05.2015
Сообщения
130
Реакции
6
Баллы
18
I need to run some code on a website and once it finishes, I need to return the data from the callback:

JavaScript:
Развернуть Свернуть Копировать
   doSomething().then(function(token) {

        return token;

       });

The problem is that the "Custom JavaScript code" block finishes before the result is ready and nothing gets returned to the variable.
How can I solve this?
 
I need to run some code on a website and once it finishes, I need to return the data from the callback:

JavaScript:
Развернуть Свернуть Копировать
   doSomething().then(function(token) {

        return token;

       });

The problem is that the "Custom JavaScript code" block finishes before the result is ready and nothing gets returned to the variable.
How can I solve this?
You should add some waiting function to your code probably.
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)