Web development , php , ajax , symfony, framework, zend
In: web resources
27 Jul 2009Over in Geneva, they have posted on coupling PHP and Workers.
They build on the great intro from John and tweak it to use simple PHP on the backend to do things such as making sure that your favourite library has been loaded into each Worker, so you can use it in your script.
The Worker implementations are doing well these days. For awhile Safari didn’t have importScripts but that changed before Safari 4. Chrome had some weird side effects too recently, and Malte Ubl posted on some strangeness that we ran into with our Bespin Worker Facade.
We tested for:
But that didn't work. Malte explains:
For some reason the statement above is actually true in Chrome 2, even though as stated above support for the Worker API has not been implemented.
I then tried to instantiate the Worker object. All this does is to throw an exception with the message "Worker is not enabled". This looks like an unfinished implementation that was only partially removed or something in that direction.
This code handles the special case:
JAVASCRIPT:
var noWorker = typeof Worker == "undefined" ? true : false; if(!noWorker) { try { new Worker("test.js") } catch(e) { e = e + "" if(e.indexOf("Worker is not enabled") != -1) { noWorker = true; } } }The bug is filed. The good news is that workers are looking pretty good these days!
This blog delivers stylish and dynamic news for designers and web-developers on all subjects of design, ranging from: CSS, Ajax, Javascript, web design, graphics, typography, advertising & much more. Our goal is to help you communicate effectively on the web with an engaging website or functional interface.