Trying to locate function in JavaScript files using Firebug

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 08:38:10
Endophage
  • Open the Script tab.
  • Type your function name in search box at top right of firebug (see spyglass).
  • You can use the next and previous buttons to jump between occurrences of the function.
  • The file name appears in the Script tab's bar, and changes for each occurrence.

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.

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!