var CSRFToken = "c378974a86c9ca19f4ab4d3cc860773e67e4be8928b35126e49e53ef83ae2b97"; 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); } }); } }