I am trying to have have a user click a button to check the status of something via API. What am I doing wrong?
HTML:
<button onclick="myFunction('http://example.com/api')">Try it</button>
JS:
<script>
function myFunction(url) {
$.get(url, function (jQuery.parseJSON(result)) {
alert(result.status);
});
}
</script>