Last active
August 29, 2015 14:02
-
-
Save modemlooper/5cd9089be5d0226775db to your computer and use it in GitHub Desktop.
jquery Oauth
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Oauth</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<div class="response"></div> | |
<button class="request">Request access</button> | |
<script> | |
$('.request').on('click', function() { | |
$('.response').html('requesting...'); | |
$.ajax({ | |
url: 'http://dev.taptappress.com/oauth1/request', | |
type: 'POST', | |
datatype: 'jsonp', | |
crossDomain: true, | |
headers: { | |
"Authorization":'Basic ' | |
}, | |
success: function( data, textStatus, xhr ) { | |
$('.response').html( JSON.stringify(data) ); | |
}, | |
error: function(data, textStatus, xhr) { | |
$('.response').html( JSON.stringify(data) ); | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment