function getSomeInfoFromServer() { $.ajax({ type: 'get', // We are doing a GET url: 'get_some_info.php', // You make this page dataType: 'json', // Its returning JSON cache: false, // Don't cache the result success: function(data, textStatus, jqXHR) { // Do something with data $('#status').html('done'); }, error: function(data, textStatus, jqXHR) { $('#status').html(textStatus); } }); }
Programming Tips - jQuery: Robust AJAX use
Date: 2017sep25
Language: javaScript
Library: jQuery
Q. jQuery: Robust AJAX use
A. I do not use the post() or get() methods because they don't
have an error callback. SO I use ajax() is is a bit more verbose but has more options.