Can I “step over” just jQuery code while debugging?

后端 未结 5 1007
陌清茗
陌清茗 2021-01-31 17:27

While stepping through a script that uses jQuery, I just want to test the code I wrote. I don\'t want to step into the jQuery file -- I\'m not

5条回答
  •  一生所求
    2021-01-31 18:10

    The answer is rather simple, you just have to refactor the function out. I can't recall

    $("div").each(function() {
       doThis(this);
    });
    
    function doThis(object) {
       $(this).hide();
    }
    

    Will almost certainly work with a halfway decent debugger.

提交回复
热议问题