Andrea Ercolino schrieb:
> Christof Donat wrote:
>   
>> I don't use jQuery in jsPax, because I load jQuery as a jsPax-package
>>
>>     
>
> It's just what I'm interested in. An independent script to add to a page and
> have it load what is needed: nice shot Christof!
>
> I've looked at your package.js, and I've found that you use the setTimeout
> method for evaluating the loaded script in the global scope, with a delay of
> 1 millisecond. Don't you have any problems with that? In another thread
> (getScript error), we were discussing alternatives because it seems not to
> work as expected, at least for a delay of 0 milliseconds.
>   
In that discussion, I was referring to this article:
http://dev.opera.com/articles/view/efficient-javascript/?page=2#timeouts

The intersting part about setTimeout:
Note that in all cases, the timeout or interval delay may not be 
honoured exactly. In general, browsers will take a little longer than 
the requested delay. Some may compensate for that with intervals by 
firing the next one slightly early instead. Others will simply try to 
wait for the correct amount of time every time. Factors such as CPU 
speed, thread states, and JavaScript load will affect the accuracy of 
the delay. Most browsers will be unable to give a delay of 0 ms, and may 
impose a minimum delay, typically between 10 and 100 ms.

I think it is good to keep this in mind when working with setTimeout.

-- 
Jörn Zaefferer

http://bassistance.de


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to