"use strict"; //requires SubmitConfirm //requires SubmitPrompt //requires SubmitChange $(function () { if (!ModernJs.isDefined(ModernJs.ContentLoader)) { ModernJs.ContentLoader = {}; ModernJs.ContentLoader.init = function () { $.ajaxSetup({ cache: false, xhrFields: { withCredentials: true } }); var getContentNodes = $("[get-content]"); var _loop = function _loop(i) { var getContentNode = $(getContentNodes[i]); var url = getContentNode.attr("get-content"); getContentNode.removeAttr("get-content"); $.ajax({ url: url, xhrFields: { withCredentials: false } }).done(function (code) { getContentNode.html(code); getContentNode.trigger("get-content"); }); }; for (var i = 0; i < getContentNodes.length; i++) { _loop(i); } }; } ModernJs.ContentLoader.init(); });