src/common/js/embed/performance.js
/**
     * send data to some backend server (using cors)
     */
send data to some backend server (using cors)
send data to some backend server ( using cors )
function transmit(type, data) {
        var xhr = new XMLHttpRequest();
        if ('withCredentials' in xhr) {
            xhr.open('POST', url);
        } else if (typeof XDomainRequest !== 'undefined') {
            xhr = new XDomainRequest();
            xhr.open('POST', url);
        } else {
            xhr = null;
        }
        if (xhr) {
            if (console && console.log) {
                console.log(type, JSON.stringify(data));
            }
        }
    }
function transmit ( type , data ) { var xhr = new XMLHttpRequest ( ) ; if ( 'withCredentials' in xhr ) { xhr . open ( 'POST' , url ) ; } else if ( typeof XDomainRequest !== 'undefined' ) { xhr = new XDomainRequest ( ) ; xhr . open ( 'POST' , url ) ; } else { xhr = null ; } if ( xhr ) { if ( console && console . log ) { console . log ( type , JSON . stringify ( data ) ) ; } } }
send data to some backend server (using cors)
send data to some backend server ( using cors )
// json sent as text/plain to make dealing with cors easier // xhr.send(JSON.stringify({ type: type, data: data }));