1

Trying to run this in a default XAMPP installation under Windows XP using Firefox 7.0.1.

Those codes:

var worker = new Worker("c:/xampp/htdocs/js/worker.js"); var worker = new Worker("c:/127.0.0.1/js/worker.js"); var worker = new Worker("c:/192.168.1.2/js/worker.js"); var worker = new Worker("worker.js"); 

Generates those errors:

Failed to load script: c:/xampp/htdocs/js/worker.js (nsresult = 0x805e0006) Failed to load script: c:/127.0.0.1/js/worker.js (nsresult = 0x805303f4) Failed to load script: c:/192.168.1.2/js/worker.js (nsresult = 0x805303f4) Script file not found: worker.js 

Maybe related: had problems with this router, for instance, I can't access my site using http://www.mydomain.com/, I have to access it using http://192.168.1.2/ .

1 Answer 1

3

You can't load scripts from your hard drive.

You need to reference files using relative or absolute paths on the server.

Sign up to request clarification or add additional context in comments.

3 Comments

I don't know about 2011, but it's false: you CAN load Workers from the hard drive. The problem is you either need to use relative paths or to use the file: protocol. Also it falls in the same restrictions as XHR, so in Chrome both are blocked, in Internet Explorer there is a prompt and in Firefox it's allowed.
@GustavoRodrigues: He said he's using XAMPP. If your page is coming from a server, you can't.
Oh, I didn't noticed that, sorry, mistake of mine.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.