1(function($) { 2 if (typeof $xa !== "undefined") { 3 /** 4 * jQuery ajax prefilter to avoid loading scripts again when form is wrapped in SXA 5 */ 6 var loadOnceScriptsFilter = function (options, originalOptions, jqXHR) { 7 var form = $("form"); 8 var isFormLoaded = form.length && typeof form.attr("data-sc-fxb") !== "undefined" && typeof $.fxbConditions !== "undefined"; 9 if (isFormLoaded && options.url.indexOf("sitecore%20modules/Web/ExperienceForms/scripts/") !== -1) { 10 jqXHR.abort(); 11 } 12 }; 13 14 /** 15 * jQuery ajax success event handler to initialize tracking when form is wrapped in SXA 16 */ 17 var initFormTracking = function (event, xhr, settings) { 18 if (settings.dataTypes.indexOf("html") >= 0 && typeof $.fxbFormTracker !== "undefined") { 19 $("form[data-sc-fxb]").track_fxbForms(); 20 } 21 }; 22 23 $xa.ajaxPrefilter("script", loadOnceScriptsFilter); 24 $xa(document) 25 .off("ajaxSuccess", initFormTracking) 26 .ajaxSuccess(initFormTracking); 27 } 28})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.