Can anyone explain this behavior, in moz/gecko?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
</head>
<body>
<script type="text/javascript">
document.write(
'<pre>',
foo,
'\n\n',
'foo(\'one\')\n ',
'foo(\'one\',\' two\')\n',
'timerID = setTimeout(foo, 1000)'
);
var timerID = null;
function foo()
{
var args = [];
for (a = 0; a < arguments.lengt h; ++a)
args.push('argu ments[' + a + '] = ' + arguments[a]);
if (timerID) args.push('time rID: ' + timerID);
alert('argument s.length = ' + arguments.lengt h + '\n\n' +
args.join('\n') );
}
foo('one');
foo('one', 'two');
timerID = setTimeout(foo, 1000);
</script>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
</head>
<body>
<script type="text/javascript">
document.write(
'<pre>',
foo,
'\n\n',
'foo(\'one\')\n ',
'foo(\'one\',\' two\')\n',
'timerID = setTimeout(foo, 1000)'
);
var timerID = null;
function foo()
{
var args = [];
for (a = 0; a < arguments.lengt h; ++a)
args.push('argu ments[' + a + '] = ' + arguments[a]);
if (timerID) args.push('time rID: ' + timerID);
alert('argument s.length = ' + arguments.lengt h + '\n\n' +
args.join('\n') );
}
foo('one');
foo('one', 'two');
timerID = setTimeout(foo, 1000);
</script>
</body>
</html>
Comment