HTML and CSS Reference
In-Depth Information
};
reader.onerror = function(evt) {
errorLogger('cannot_read_file', 'The file specified cannot be read');
};
reader.readAsText(event.target.files[0]);
}
If you execute the load from CSV functionality now you will not notice anything different
(unless you loaded an enormous file). Despite that, the parsing of the CSV file is now oc-
curring on a background thread rather than the main browser thread.
The Web Worker will remain open even after it has processed our message, and would ac-
cept additional messages if we were to send them. The Web Worker can close itself with a
call to:
self.close()
Or in our case the Web Worker will close when the loadFromCSV function ends, and the
worker variable falls out of scope.
Search WWH ::




Custom Search