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

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


Steffen Kamper schrieb:
> Hi Masi,
> 
> 
> Martin Kutschker schrieb:
>> Steffen Kamper schrieb:
>>> 2) one JS-function used in doble quotes
>>
>>
>> That one is strange. Why do you think this is buggy?
>>
>> The first parameter of setTimeout() is supposed to be a string that will
>> be evaluated at the given time (even MS's docs say so). The way it is
>> now, "busy.startTimer()" will be executed immediately.
>>
>> Masi
> 
> This is what JSlint says:
> Implied eval is evil. Pass a function instead of a string.
> 
> The reason may simple: JS eval this expression. If there is something to
> eval, it's ok, but if it's just a simple function call, eval is don't
> needed.
> 
> Browsers are happy with both, i checked that.
> The docs don't tell anything about the possibility, may be you find
> something.

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.

Masi


More information about the TYPO3-team-core mailing list