var CSRFToken = "d02d37457b3ec940c8a54a1c8d755f0d1f7d2472e5205e51d78a0aeb7c548921"; var $xo = jQuery.noConflict(); var $jq = $xo; setSpecificRequestHeader("$xo"); setSpecificRequestHeader("$jq"); if ($ == null) { var $ = $xo; setSpecificRequestHeader("$"); } function setSpecificRequestHeader(jqtype) { if (typeof window[jqtype] == 'function') { window[jqtype](document).ajaxSend(function( event, request, settings ) { if (!(/^http:./.test(settings.url) || /^https:./.test(settings.url))) { // Only send the token to relative URLs i.e. locally. request.setRequestHeader("X-CSRFToken",CSRFToken); } }); } }