Created
January 6, 2019 13:57
-
-
Save bDrwx/434e90c813fab16995588bbd07eb13b7 to your computer and use it in GitHub Desktop.
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
function getUrlVars() { | |
var vars = {}; | |
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { | |
vars[key] = value; | |
}); | |
return vars; | |
} | |
$(document).ready(function() { | |
$.ajax({ | |
type: "GET", | |
url: 'https://p8dmwkfw4d.execute-api.ap-southeast-1.amazonaws.com/default/ruby-function', | |
data: 'username='.getUrlVars().username, | |
contentType: 'application/json', | |
success: function(res){ | |
console.log(res);}, | |
error: function(){ | |
console.log('Something get wrong!');} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment