Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/b01110011.recaptcha/install/assets/js/ |
Upload File : |
window.recaptcha.token = ''; window.recaptcha.stid = null; // setTimeout id window.recaptcha.reloadToken = function() { if (typeof(grecaptcha) === 'undefined') return; clearTimeout(this.stid); this.stid = setTimeout(() => { this.reloadToken(); }, this.tokenLifeTime * 1000); grecaptcha.ready(() => { grecaptcha.execute(this.siteKey, {action: 'homepage'}).then(token => { this.token = token; }); }); }; window.recaptcha.getToken = function() // пользуемся этим методом когда нужно получить токен { var oldToken = this.token; this.reloadToken(); return oldToken; }; document.addEventListener('DOMContentLoaded', function() { window.recaptcha.reloadToken(); document.querySelectorAll('input[name=recaptcha_token]').forEach(item => { item.form.onsubmit = () => { item.value = window.recaptcha.getToken(); }; }); });