Answer the question
In order to leave comments, you need to log in
How to notify the user when changing the value of a variable?
Hello.
Tell me what you need to see and read, and it is desirable that there are examples, How to notify the user when the value of a variable changes?
More details:
The user is on the site https://mysite.ru/ (1C BITRIXCMS). And I need it to make an ajax request with an interval of 10 - 15 seconds or similar solutions that you can recommend. to /status.php with "change cod= 4054656", by default the server returns the response number 0, but when the response number to "/statu.php" is updated, the user will be notified.
Thanks in advance for your attention;)
Answer the question
In order to leave comments, you need to log in
ajax is a way to pass data (i.e. the logic of the handler will not change whether you use it or not)
/* получаете переменную которая у пользвателя и ту с которой сравниваете, ну и собственно сравниваете */
if($userVar != $systemVar){
return $notice;
}
function yourAjaxRequest(){
// описываете ajax запрос
}
// задаете вызываемую функцию и интервал частоты запросов в мс (в примере 15 сек)
setInterval( yourAjaxRequest, 15000 );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question