The following code when ran in IE6 (not sure about 7) will produce
some kind of leak. It can be identified by bringing up 'Windows Task
Manager' and viewing the CPU Usage History. The CPU hits slowly
increase over time. (Link against jquery-1.1.3.1.pack.js)


Is there an error in my code?

<html>

  <head>
    <script language="javascript" src="jquery.js"></script>
    <script language="javascript">

        var timerTask;
        $(document).ready(function() {

            timerTask = window.setTimeout( callback, 500 );
        });

        function callback() {

            $( 'a' ).each( function( index ) {

                $( this ).unbind( 'click' ).click( 'linkClicked' );
                this.onclick = null;
            });

            window.clearTimeout( timerTask );
            timerTask = window.setTimeout( callback, 500 );
        }
    </script>

  </head>

  <div id="count">
  </div>

  <div id="testing">
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
    <a href="testing.html">Test</a><br/>
  </div>

</html>

Reply via email to