Search code examples
javascriptjqueryfirebug

How to debug dynamic JavaScript functions in FireBug


I have some JavaScript functions like this:

function onSelectRow_${itemid}(){
   something;
}

This it is appearing like this in Firebug script tab:

function onSelectRow_87878(){
     something;
}

I put multiple break points (it has more than 20 lines, I put one in for example) in Firebug -> Script tab.

But the problem is, Firebug is not able to do debug these methods, ie. it is not stopping execution it executing as usual. I tried multiple times.

This is my actual code and use:

function onSelectRow_${escapedId }(rowId){
}
    

<jqgrid:grid onSelectRow="onSelectDeviceRow_${escapedId }"

What can I try to resolve it?


Solution

  • You can use debugger

    function onSelectRow_87878()
    {
         debugger; //add here
         something;
    }
    

    When you open Firebug, enable Script,and it will automatically go to the debugger point

    debugging in firefox