Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function JSONParseAsync( text, callback ) {
- var code = 'onmessage = function ( e ) { postMessage( JSON.parse( e.data ) ); close(); }';
- var blob = new Blob( [ code ], { type: 'text/plain' } );
- var worker = new Worker( window.URL.createObjectURL( blob ) );
- worker.addEventListener( 'message', function ( e ) { callback( e.data ); } );
- worker.postMessage( text );
- }
Add Comment
Please, Sign In to add comment