jQuery(function ($) { matriz.global.theme = { "site": {}, "utils": { "debugging": { "route": function (surl) { var url = new URL(surl); $.ajax({ "url": surl }).always(function matriz_global_theme_site_utils_debugging_route_ajax_always_begin() { console.log("[BEGIN DEBUG routeGet(" + url.pathname + ")]"); console.group(); console.log("GET " + surl); }).done(function matriz_global_theme_site_utils_debugging_route_ajax_done() { console.log("OK"); }).fail(function matriz_global_theme_site_utils_debugging_route_ajax_fail(jqXHR) { console.log("FAIL " + jqXHR.status); console.group(); console.log("[BEGIN SERVER RESPONSE] "); console.error(jqXHR.responseText); console.log("[/END SERVER RESPONSE]"); console.groupEnd(); }).always(function matriz_global_theme_site_utils_debugging_route_ajax_always_begin() { console.groupEnd(); console.log("[/END DEBUG routeGet(" + url.pathname + ")]"); }); } } } }; });