Created
December 8, 2014 11:15
-
-
Save jbrunemann/a2c57809c30c7cfa65cc 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script> | |
$(document).ready(function () { | |
var variables = { | |
username: "abc", | |
password: "xyz" | |
}; | |
var jsonString = JSON.stringify(variables); | |
// This one is essential for IE8! | |
$.support.cors = true; | |
$.ajax({ | |
type: "POST", | |
url: "https://sandbox.api.cso20.net/v1/JobAPI/getApiKey.json", | |
data: {args: jsonString}, | |
dataType: "json" | |
}).done(function (data) { | |
$("h2").text(data.result); | |
}).fail(function (jqXHR, textStatus, errorThrown) { | |
$("h2").text(textStatus); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<h2></h2> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment