F
F
fandorin_official2018-01-15 17:28:27
JavaScript
fandorin_official, 2018-01-15 17:28:27

How to know if a button press has ended?

All good.
Tell me please.
There is a script. In the process of work, he clicks on the site on two buttons and then on the script. The code is something like this:

$('.read_htable input[name=bet]').val(parseFloat(current_bet).toFixed(8));
        button= callnetwork(); //алгоритм, определяющий на какую из кнопок нажимать
        var readPlayBtn = $('.read_htable .clreadPlay')[button];
        readPlayBtn.click();

Sometimes, the site freezes a little, and after clicking the button, the response from the site may be delayed. Is it possible to somehow track when the button is pressed and you can continue the script execution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ruchiev, 2018-01-15
@denis_bardak

The click itself happens exactly at the moment of execution of the line readPlayBtn.click(); but sending data, receiving a response, or whatever the button does there, placing a bet ... occurs with a delay. Those. here it would be more logical not to emit a button click, but to execute this request directly from js, get a response and go further through the script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question