jquery - How to debug JavaScript closure? -


  1. the question why debug function, how know closure content function refer to?

    i'm aware google chrome display closure in "scope variables" section, other browsers? (updated: ff has similar thing doesn't call "closure" local variables)

  2. motivation of first question coming along while reading <learning jquery,3rd edition> - appendix a.

    at page 355, author saying following code fragment cause memory leak @ ie because of loop reference(click handler refer closure content has dom button).

    i'm curious whether case debug click handler closure content.however google chrome doesn't show closure variable.

    thus i'm wondering how author know loop reference issue..


$(document).ready(function() { var button = document.getelementbyid('button-1'); button.onclick = function() { $.print('hello'); return false; }; }); 

thank you.

i refer use firebug debug code. best plugin available dont have exact answer question may have @ these links.

tools debugging memory leaks in javascript

how trace or debug javascript closures in firebug

debugging closures in javascript

you can check out youtube link more information.

hope have tried answering useful.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -