Great ! I'm just missing a feature i'm trying to add : do XHR from the
worker.
The worker has to send a message to the parent thread that does the
request and send back the result to the worker.
It schouldn't be hard to implement on top of your code...
For those who, like me, use YUI :
Here is a hack to replace the doRequest function from the xhr.js file
using YUI :
function doRequest(method, url, postData, callbackFct) {
var successFunc = function(o) { callbackFct(o.status, o.statusText,
o.responseText); };
var xhr = YAHOO.util.Connect.asyncRequest(method, url, { success:
successFunc}, postData);
return function() { YAHOO.util.Connect.abort(xhr); };
};
Don't forget to include : (or from your server...)
<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/
build/yahoo/yahoo-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/
build/connection/connection-min.js"></script>