You could load it with the script you want upon creation, passing in either the scriptUrl or scriptSource directly to the call to create the worker.
If its up and running and you need more... from inside the worker, you should be able to fetch it and eval it into your context... scriptSource = http.get(url); eval(scriptSource); On Thu, Sep 17, 2009 at 2:46 PM, Steve Patrick < steve.patrick.mar...@gmail.com> wrote: > > Hi everybody, > I´ve got a worker thread and needs to import a javascript file to run. > I can´t do a document.write('<script src="my_script.js"></script>') > because document object doesn´t exist in a worker thread. And > according to the documentation "created workers do not automatically > inherit script code from their parents". > So how can I import a javascript file in my worker?? > Thanks!!! >