Using Web Workers in a Phone Call

I am trying to create an HTML5 web worker in a phone table, but the phone book does not allow loading a local javascript file at runtime. I get the following error:

var web_worker=new Worker('socket-worker.js') undefined file://socket-worker.jsFailed to load resource: The requested URL was not found on this server. 

Does anyone have a good suggestion on how I can get around this and get the worker to work?

Thanks!

+6
source share
2 answers

I have not tried this yet, but I believe that we can run it using blob-url. See Here ( http://www.html5rocks.com/en/tutorials/workers/basics/#toc-inlineworkers-bloburis )

Update: I already tried this and it worked. :)

+8
source

According to my knowledge, web workers never work in a local directory

file://

It works on the server side. For example, instead of placing files in "file: //", so the path should be

 ***> http://localhost/ or*** ***> http://server_ip_address*** 

Therefore, Phonegap consists of HTML and Javascript, which are located in the device directory, so web workers are not supported in Phonegap.

+1
source

All Articles