2 回答
TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超10個(gè)贊
內(nèi)聯(lián)處理程序幾乎肯定會(huì)引用全局變量,因此您可以打開(kāi)控制臺(tái)并記錄該變量,這將為您提供函數(shù)位置及其代碼:
const foo = 'some code';
function fn() {
console.log('fn running');
}
// when you have the function name, console.dir it
// to find its location:
console.dir(fn);
// console.log it to find its code:
console.log(fn);

您可以單擊右側(cè)的鏈接,[[FunctionLocation]]轉(zhuǎn)到“源”面板中定義該函數(shù)的位置。
TA貢獻(xiàn)1818條經(jīng)驗(yàn) 獲得超11個(gè)贊
右鍵單擊檢查標(biāo)簽或按鈕,
在開(kāi)發(fā)人員工具中選擇“事件監(jiān)聽(tīng)器”選項(xiàng)卡,如下所示

展開(kāi)click它不會(huì)顯示為 onclick 它將顯示為click

- 2 回答
- 0 關(guān)注
- 180 瀏覽
添加回答
舉報(bào)
