Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:1765540465bd2c48888d
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$.get('/path/to/url', function (data) {
if( !data || data === ""){
// error
return;
}
var json;
try {
json = jQuery.parseJSON(data);
} catch (e) {
// error
return;
}
// use json here
}, "text");

Neat script. This saved my bacon recently so thanks a lot. One question: why does the dataType need to be set to 'text'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.