Skip to content

Instantly share code, notes, and snippets.

@gzalinski
Last active May 25, 2022 14:35
Show Gist options
  • Save gzalinski/09bb1bd9b63a7eb4e7caed44364a86d9 to your computer and use it in GitHub Desktop.
Save gzalinski/09bb1bd9b63a7eb4e7caed44364a86d9 to your computer and use it in GitHub Desktop.
[jQuery catch ajax complete event] #js #snippet #ajax
$(document).ajaxComplete(function (event, xhr, settings) {
//if (!settings.url.includes('update_listing_account')) { return; }
if (typeof settings.data != 'object') { return }
if (settings.data.get('action') != 'update_listing_account') { return }
if (typeof xhr.responseText != 'undefined') {
const response = $.parseJSON(xhr.responseText)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment