[TYPO3-core] FYI: #10375: 2 little JS-Errors that bug IE

Martin Kutschker masi-no at spam-typo3.org
Sat Feb 7 22:59:19 CET 2009


Steffen Kamper schrieb:
> Martin Kutschker schrieb:
> 
>>> But Steffen, please have a look what you pass as parameter to
>>> setTimeout(). The way you have written it is the *return value* of the
>>> function call busy.startTimer(). The reason is the brackets! You may
>>> pass either a function or a string to be evaluated.
>>
>> Docs with examples:
>>
>> https://developer.mozilla.org/en/DOM/window.setTimeout
>> http://msdn.microsoft.com/de-de/library/ms536753(en-us,VS.85).aspx
>>
>> Masi
> 
> thanks Masi. I will do a simple document to check different behaviour in
> FF ans IE to verify.
> 
> Funny that we have such in code:
> setTimeout(function() {
>     $('search-query').activate();
> }, 200);
> 
> which also shouldn't work?

In this case an anonymous function is passed to setTimeout() which will
be called after 200 ms. Compare it with this code:

setTimeout($('search-query').activate(), 200);

In this case activate() is called immediately.

Masi


More information about the TYPO3-team-core mailing list