Created
October 11, 2017 14:46
-
-
Save zlatkov/c5fc0706d2d37ce3bb9db75e8a991807 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 loadData() { | |
try { // Catches synchronous errors. | |
getJSON().then(function(response) { | |
var parsed = JSON.parse(response); | |
console.log(parsed); | |
}).catch(function(e) { // Catches asynchronous errors | |
console.log(e); | |
}); | |
} catch(e) { | |
console.log(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment