Skip to content

Instantly share code, notes, and snippets.

@modemlooper
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save modemlooper/5cd9089be5d0226775db to your computer and use it in GitHub Desktop.
Save modemlooper/5cd9089be5d0226775db to your computer and use it in GitHub Desktop.
jquery Oauth
<!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