Reputation: 15298
I'm trying to locate this function call myFooBar() that is referenced inline in some HTML but the page loads tons of JavaScripts and it's quite some work to search that function in each of those files. How can I locate in which JavaScript file this function lives using Firebug?
Upvotes: 5
Views: 5173
Reputation: 21483
By going to the script tab you are only searching js on the page, if you try this in the html or css tabs you will only be searching for occurrences of your entered text within those specific content types.
Upvotes: 7
Reputation: 20140
If you like to see the function definition type the function name in the console. If you want to know which java script file then Right click the inspect element.Select the resource tab.Then put the function name on the search box to search for it.You will see the number of occurrences of that function.Hope this tip will help as well.
But also remember that it is not possible always to find out which java file it was.If you are using smarty in your project then some java script might be inline inside the tpl file
Upvotes: 0
Reputation: 21
If you want only to see the source code of the method and know the correct function name. Just execute alert( myFooBar ); on Firebug console.
Upvotes: 2