![]() |
![]() |
By continuing to use the site you agree to our privacy policy Terms and Conditions.
// 在表单提交前获取token document.getElementById('f_form').addEventListener('submit', function(e) { e.preventDefault(); // 阻止表单默认提交 // 获取reCAPTCHA token grecaptcha.execute('6Lc5weQrAAAAAHxAIVPEB6D5kPatTec0YHWO8xUf', { }).then(function(token) { // 将token设置到隐藏字段 document.getElementById('g-recaptcha-response').value = token; // 提交表单 document.getElementById('myForm').submit(); }); });