Home  >  Q&A  >  body text

javascript - How to find the source code corresponding to the js function in the page?

<p id="period_week" onclick="confirm_cash()" class="btn_confirm">确认提现</p>

You can see onclik="confirm_cash()" from the html source code. How can I find the source code of the confirm_cash() function?

I searched globally for this function name on the current page, but did not find the corresponding JS

Click this button and the firebug script page will display: This page does not contain JavaScript.

Please give me some advice. Thanks.

曾经蜡笔没有小新曾经蜡笔没有小新2685 days ago849

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-07-05 11:02:06

    1. Method 1: View the function source code
      Input confirm_cash.toString() directly on the console, and you can see the function source code.

    2. Method 2: See the function source code and source files
      Open the console: CtrlShiftF (find all source files), check the box to use regular expressions, enter confirm_cashs*=s*function or functions*confirm_cashs*(, you can find the corresponding source files and function source codes.

    P.S.: Tested under chrome, but it should also work with firebug, but the corresponding shortcut keys may be different.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-07-05 11:02:06

    Enter console.log(confirm_cash) in the console;

    reply
    0
  • Cancelreply