Created
July 22, 2011 06:10
-
-
Save jaydson/1098967 to your computer and use it in GitHub Desktop.
BrowserID test for Blog Post in Jaydson.org
This file contains 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
<html> | |
<head> | |
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js' type="text/javascript"></script> | |
<script src="https://browserid.org/include.js"></script> | |
</head> | |
<body> | |
<img id="sign-in" src="https://browserid.org/i/sign_in_green.png" alt="Sign in"> | |
<div id="logged" style='display:none'></div> | |
<script> | |
$("#sign-in").bind("click", function(){ | |
navigator.id.getVerifiedEmail(function(assertion){ | |
if(assertion){ | |
$.ajax({ | |
url: "https://browserid.org/verify?assertion="+assertion+"&audience=jaydson.org", | |
success: function(data){ | |
var user = JSON.parse(data); | |
$('#logged').html("<h1>Welcome, "+user.email+"</h1>").fadeIn(); | |
} | |
}); | |
}else{ | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment