Skip to content

Instantly share code, notes, and snippets.

@ckahle33
Created July 15, 2014 20:25
Show Gist options
  • Select an option

  • Save ckahle33/bf6ba99ea4cb48a195e0 to your computer and use it in GitHub Desktop.

Select an option

Save ckahle33/bf6ba99ea4cb48a195e0 to your computer and use it in GitHub Desktop.
function mlgGetCoreList () {
var cores = '';
$.ajax({
type: "GET",
url: 'http://qa.mylittlegolfer.com/prolibapi/v1/core/?format=json',
dataType: "json",
// data: {
// action: "mlg_get_core_list",
// },
success: function( json, status, jqXHR ) {
try {
cores = $.parseJSON(json);
mlg_core_cards( cores );
} catch( err ) {
mlg_ajax_caught_error("There was an unexpected error during the core list retrieval attempt. Please try again.", err, jqXHR );
return false;
}
},
// code to run if the request fails; the raw request and
// status codes are passed to the function
error: function( xhr, status, errorThrown ) {
mlg_ajax_error_thrown( xhr, status, errorThrown );
return false;
},
// code to run regardless of success or failure
complete: function( xhr, status ) {
// Do nothing
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment