dist/webworker_example/index.js
function createWorker() {
    var worker = new Worker('worker.js');

    // On worker messsage
    worker.onmessage = function(event) {
        if (event.data.event === 'done') {
            console.log('done:', event.data.data);
            $('#start').show();
            $('#abort').hide();
        }
        else if (event.data.event === 'progress') {
            console.log('progress:', event.data.data.percent, '%');
        }
    };

    return worker;
}
function createWorker() {
    var worker = new Worker('worker.js');

    // On worker messsage
    worker.onmessage = function(event) {
        if (event.data.event === 'done') {
            console.log('done:', event.data.data);
            $('#start').show();
            $('#abort').hide();
        }
        else if (event.data.event === 'progress') {
            console.log('progress:', event.data.data.percent, '%');
        }
    };

    return worker;
}
function createWorker ( ) { var worker = new Worker ( 'worker.js' ) ; // On worker messsage worker . onmessage = function ( event ) { if ( event . data . event === 'done' ) { console . log ( 'done:' , event . data . data ) ; $ ( '#start' ) . show ( ) ; $ ( '#abort' ) . hide ( ) ; } else if ( event . data . event === 'progress' ) { console . log ( 'progress:' , event . data . data . percent , '%' ) ; } } ; return worker ; }
Create and return the Worker object
Create and return the Worker object