<script type="text/javascript"> window.onload = function(){ document.getElementById('a').onclick = function(i) { return function() { document.body.innerHTML = --i > 0 ? i : 'Oops!'; window.setTimeout(arguments.callee, 1000); return false; }; }(60); }; </script> <a href="#" id="a">click</a>
<span id='timer'>60</span> <input type='button' onclick='start(); this.onclick = new Function;' value='начать отсчёт' /> <script type='text/javascript'> function start() { var t = document.getElementById("timer"); setTimeout(function () { if (--t.innerHTML == 0) t.innerHTML = "Time is out!"; else setTimeout(arguments.callee, 1000); }, 1000); } </script>
arguments.callee // TypeError arguments.caller // TypeError