Created
January 4, 2018 15:12
-
-
Save DeVoresyah/f9c90b4bc358877bdcb11d7827350542 to your computer and use it in GitHub Desktop.
Memasang Google ReCaptcha di Halaman Web (Client-side)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Memasang Google ReCaptcha di Halaman Web (Client-side)</title> | |
<script src='https://www.google.com/recaptcha/api.js'></script> | |
</head> | |
<body> | |
<div class="g-recaptcha" data-sitekey="SITE-KEY"></div> | |
<button type="button" onclick="verify()">Verify</button> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<script> | |
function verify(){ | |
var anti_bot = grecaptcha.getResponse(); | |
if (anti_bot.length == 0) { | |
alert('ReCaptcha is Successfully Verified') | |
} else { | |
alert('ReCaptcha is Not Verified') | |
} | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment