Zepto doesn't support ajaxSetup.. Trying to come up with a solution there. can.zepto.js already is injecting itself in @.ajaxSettings.xhr... I'll try the same pattern.
,,,
tried
var oldXHR = $.ajaxSettings.xhr;
$.ajaxSettings.xhr = function(){
var xhr = oldXHR();
xhr.setRequestHeader("X-Platform", "mobile");
... other stuff...
return xhr;
};
When I ran a model call:
Error: INVALID_STATE_ERR: DOM Exception 11
However, I did find that zepto does have ajaxBeforeSend event
$(document).on('ajaxBeforeSend', function(e, xhr, options) {
xhr.setRequestHeader("X-Platform", "mobile");
....
}