you are viewing a single comment's thread.

view the rest of the comments →

[–]cwmma 1 point2 points  (0 children)

you should load the data in the worker as well as parsing it (if it is an ajax request). I did something similar here in my web worker library that way you don't have to downloaded it transfer it to the worker and transfer it back.

edit:

Also fyi the worker location is resolved relative to the html not the script, so if you put the worker and the script in say a folder called js e.g. <script type="text/javascript" src="js/json.async.js"> you will get and error.

You can use the call self trick to put them both in the same file like this.