تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
5283 أدوات العرض

The js script looks like this:


var sweetcaptcha = new require('sweetcaptcha')(appId, appKey, appSecret); // your sweetCaptcha application credentials, see https://sweetcatpcha.com/accounts/signin
// Get your captcha
function getCaptcha(callback) {
sweetcaptcha.api('get_html', callback); // callback should be function(err, html) {...}
}
// Validate using sckey and scvalue, hidden inputs from previous HTML
function validateCaptcha(captchaKey, captchaValue, callback) {
// callback = function(err, isValid) {...}
sweetcaptcha.api('check', {sckey: captchaKey, scvalue: captchaValue}, function(err, response){
if (err) return callback(err);
if (response === 'true') {
// valid captcha
return callback(null, true);
}
// invalid captcha
callback(null, false);
});
}
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مايو 25
9354
3
مارس 24
4887
0
أبريل 23
442
1
نوفمبر 23
5066
2
ديسمبر 22
5536