function LongPollingTransport() {
        var _super = new cometdModule.LongPollingTransport();
        var that = cometdModule.Transport.derive(_super);

        that.xhrSend = function(packet) {
            return $.ajax({
                url: packet.url,
                async: packet.sync !== true,
                type: 'POST',
                contentType: 'application/json;charset=UTF-8',
                data: packet.body,
                global: false,
                xhrFields: {
                    // For asynchronous calls.
                    withCredentials: true
                },
                beforeSend: function(xhr) {
                    // For synchronous calls.
                    xhr.withCredentials = true;
                    _setHeaders(xhr, packet.headers);
                    // Returning false will abort the XHR send.
                    return true;
                },
                success: packet.onSuccess,
                error: function(xhr, reason, exception) {
                    packet.onError(reason, exception);
                }
            });
        };

        return that;
    }
// Remap toolkit-specific transport calls.
Remap toolkit-specific transport calls.
Remap toolkit - specific transport calls .
function LongPollingTransport() {
        var _super = new cometdModule.LongPollingTransport();
        var that = cometdModule.Transport.derive(_super);
        that.xhrSend = function(packet) {
            return $.ajax({
                url: packet.url,
                async: packet.sync !== true,
                type: 'POST',
                contentType: 'application/json;charset=UTF-8',
                data: packet.body,
                global: false,
                xhrFields: {
                    withCredentials: true
                },
                beforeSend: function(xhr) {
                    xhr.withCredentials = true;
                    _setHeaders(xhr, packet.headers);
                    return true;
                },
                success: packet.onSuccess,
                error: function(xhr, reason, exception) {
                    packet.onError(reason, exception);
                }
            });
        };
        return that;
    }
function LongPollingTransport ( ) { var _super = new cometdModule . LongPollingTransport ( ) ; var that = cometdModule . Transport . derive ( _super ) ; that . xhrSend = function ( packet ) { return $ . ajax ( { url : packet . url , async : packet . sync !== true , type : 'POST' , contentType : 'application/json;charset=UTF-8' , data : packet . body , global : false , xhrFields : { withCredentials : true } , beforeSend : function ( xhr ) { xhr . withCredentials = true ; _setHeaders ( xhr , packet . headers ) ; return true ; } , success : packet . onSuccess , error : function ( xhr , reason , exception ) { packet . onError ( reason , exception ) ; } } ) ; } ; return that ; }
Remap toolkit-specific transport calls.
Remap toolkit - specific transport calls .
// For asynchronous calls. // For synchronous calls. // Returning false will abort the XHR send.