Find js function with firebug

拈花ヽ惹草 提交于 2019-11-28 20:16:52

问题


I have the following button:

<input type="submit" id="btnLogin" onclick="return ValidateLogin();" value="Enter">

How can i find the definition of the ValidateLogin() function with firebug?


回答1:


Type the following into the Firebug Console, then click the function() in the output window

var s = ValidateLogin.prototype.constructor;
console.log(s); // will output the actual function definition 

I have included some screenshots to help.




回答2:


To get the function definition only this would be a shortcut in the firebug console:

console.log(ValidateLogin.toString());

The defintion of the function will be printed to the console directly.




回答3:


There is a search field on the top right of Firebug. When you are on the Script panel and focus the search field, you'll get a small dialog which a check box "Multiple Files" (or something similar - I don't have the English version). Check it and copy the name of the Function you are looking for into it.




回答4:


go to HTML label. Here you can view also the contents of the Javascript file included in the page.

I hope it's helpful.



来源:https://stackoverflow.com/questions/5469691/find-js-function-with-firebug

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