本文介紹了如何在 IE8 中轉儲 JavaScript 變量?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我有一個需要在 IE8 中檢查的對象.我嘗試了開發(fā)人員工具和 console.log
,它們的 Firebug 等效項.但是,當我將對象輸出到日志時:
I have an object I need to examine in IE8.
I tried the developer tools and console.log
, their Firebug equivalent.
However, when I output the object to the log:
console.log("Element: ", element);
console.log(element);
我只得到字符串
LOG: Element: [object Object]
而不是可點擊、可檢查的轉儲.
instead of a clickable, examinable dump.
是否可以像在 Firebug 中一樣將對象轉儲到日志并檢查其成員?
Is it possible to dump an object to the Log and examine its members, like in Firebug?
我不能使用自制的 dump() 函數,因為我要檢查的元素太大,瀏覽器會在我身上崩潰.
I can't use a homemade dump() function because the element I want to examine is so huge the browser will crash on me.
推薦答案
這是我發(fā)現(xiàn)有用的一種技術:
Here's one technique that I've found helpful:
- 打開開發(fā)者工具欄(按 F12)
- 轉到腳本"標簽
- 點擊開始調試"按鈕
- 接下來,在控制臺中輸入debugger"并回車.這應該會觸發(fā)一個斷點.
- 轉到觀看"子標簽
- 點擊顯示點擊添加..."的行并輸入您要檢查的變量.請注意,該變量必須是全局可用的.
- 此時您應該能夠使用樹狀 UI 檢查變量
- 完成調試后,點擊繼續(xù)按鈕(或按 F5)
這篇關于如何在 IE8 中轉儲 JavaScript 變量?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯(lián)網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!