Файл: demos/js/script.js
Строк: 39
<?php
jQuery(document).ready(function($) {
$("#refresh").on('click', function(e) {
e.preventDefault();
$("#challenge").attr("src", "captcha.png?" + (new Date()).getTime());
$("#qrcode").attr("src", "qrcode.png?" + (new Date()).getTime());
});
$('#submit').on('click', function(e) {
e.preventDefault();
$.ajax({
type: 'post',
url: 'verificate.php',
data: {
challenge: $('#challengeInput').val(),
},
dataType: 'json',
success: function(response) {
if (response === true) {
alert('Hurray!, You're not a bot.');
$("#challenge").attr("src", "captcha.png?" + (new Date()).getTime());
$("#qrcode").attr("src", "qrcode.png?" + (new Date()).getTime());
} else {
alert('Get Out Skynet!');
}
},
error: function(data) {
alert('something goes wrong... reloading');
window.location.reload();
}
});
});
});
?>