javascript圍觀IE10中window物件的結構
我在<<javascript遍歷DOM結構和物件結構>>一文中提供了一個遍歷物件結構的函式,利用這個函式,展現IE10中window物件的結構(還真是不少啊~除錯程式碼也在呢~)如下:
除錯資訊:
[Object] window
|–[function] addEventListener = function addEventListener() { [native code] }
|–[function] alert = function alert() { [native code] }
|–[number] animationStartTime = 7011862239376.545
|–[object] applicationCache
|–[function] atob = function atob() { [native code] }
|–[function] attachEvent = function attachEvent() { [native code] }
|–[function] blur = function blur() { [native code] }
|–[function] btoa = function btoa() { [native code] }
|–[function] cancelAnimationFrame = function cancelAnimationFrame() { [native code] }
|–[function] clearDbgInfo = function clearDbgInfo(){ document.getElementById(“dbg”).innerHTML=””; }
|–[function] clearImmediate = function clearImmediate() { [native code] }
|–[function] clearInterval = function clearInterval() { [native code] }
|–[function] clearTimeout = function clearTimeout() { [native code] }
|–[object] clientInformation
|–[object] clipboardData
|–[function] close = function close() { [native code] }
|–[boolean] closed = false
|–[function] confirm = function confirm() { [native code] }
|–[object] console
|–[function] createPopup = function createPopup() { [native code] }
|–[string] defaultStatus =
|–[function] detachEvent = function detachEvent() { [native code] }
|–[function] dispatchEvent = function dispatchEvent() { [native code] }
|–[object] document
|–[object] event
|–[function] execScript = function execScript() { [native code] }
|–[object] external
|–[function] focus = function focus() { [native code] }
|–[object] frameElement
|–[object] frames
|–[function] getComputedStyle = function getComputedStyle() { [native code] }
|–[function] getSelection = function getSelection() { [native code] }
|–[object] history
|–[undefined] indexedDB = undefined
|–[number] innerHeight = 519
|–[number] innerWidth = 1143
|–[function] item = function item() { [native code] }
|–[number] length = 0
|–[undefined] localStorage = undefined
|–[object] location
|–[function] matchMedia = function matchMedia() { [native code] }
|–[number] maxConnectionsPerServer = 10
|–[function] moveBy = function moveBy() { [native code] }
|–[function] moveTo = function moveTo() { [native code] }
|–[number] msAnimationStartTime = 7011862239376.545
|–[function] msCancelRequestAnimationFrame = function msCancelRequestAnimationFrame() { [native code] }
|–[function] msClearImmediate = function msClearImmediate() { [native code] }
|–[undefined] msIndexedDB = undefined
|–[function] msIsStaticHTML = function msIsStaticHTML() { [native code] }
|–[function] msMatchMedia = function msMatchMedia() { [native code] }
|–[function] msRequestAnimationFrame = function msRequestAnimationFrame() { [native code] }
|–[function] msSetImmediate = function msSetImmediate() { [native code] }
|–[function] msWriteProfilerMark = function msWriteProfilerMark() { [native code] }
|–[string] name =
|–[function] navigate = function navigate() { [native code] }
|–[object] navigator
|–[string] offscreenBuffering = auto
|–[object] onabort
|–[object] onafterprint
|–[object] onbeforeprint
|–[object] onbeforeunload
|–[object] onblur
|–[object] oncanplay
|–[object] oncanplaythrough
|–[object] onchange
|–[object] onclick
|–[object] oncontextmenu
|–[object] ondblclick
|–[object] ondrag
|–[object] ondragend
|–[object] ondragenter
|–[object] ondragleave
|–[object] ondragover
|–[object] ondragstart
|–[object] ondrop
|–[object] ondurationchange
|–[object] onemptied
|–[object] onended
|–[object] onerror
|–[object] onfocus
|–[object] onfocusin
|–[object] onfocusout
|–[object] onhashchange
|–[object] onhelp
|–[object] oninput
|–[object] onkeydown
|–[object] onkeypress
|–[object] onkeyup
|–[object] onload
|–[object] onloadeddata
|–[object] onloadedmetadata
|–[object] onloadstart
|–[object] onmessage
|–[object] onmousedown
|–[object] onmouseenter
|–[object] onmouseleave
|–[object] onmousemove
|–[object] onmouseout
|–[object] onmouseover
|–[object] onmouseup
|–[object] onmousewheel
|–[object] onmsgesturechange
|–[object] onmsgesturedoubletap
|–[object] onmsgestureend
|–[object] onmsgesturehold
|–[object] onmsgesturestart
|–[object] onmsgesturetap
|–[object] onmsinertiastart
|–[object] onmspointercancel
|–[object] onmspointerdown
|–[object] onmspointerhover
|–[object] onmspointermove
|–[object] onmspointerout
|–[object] onmspointerover
|–[object] onmspointerup
|–[object] onoffline
|–[object] ononline
|–[object] onpause
|–[object] onplay
|–[object] onplaying
|–[object] onpopstate
|–[object] onprogress
|–[object] onratechange
|–[object] onreadystatechange
|–[object] onreset
|–[object] onresize
|–[object] onscroll
|–[object] onseeked
|–[object] onseeking
|–[object] onselect
|–[object] onstalled
|–[object] onstorage
|–[object] onsubmit
|–[object] onsuspend
|–[object] ontimeupdate
|–[object] onunload
|–[object] onvolumechange
|–[object] onwaiting
|–[function] open = function open() { [native code] }
|–[undefined] opener = undefined
|–[number] outerHeight = 617
|–[number] outerWidth = 1149
|–[number] pageXOffset = 0
|–[number] pageYOffset = 0
|–[object] parent
|–[object] performance
|–[function] postMessage = function postMessage() { [native code] }
|–[function] print = function print() { [native code] }
|–[function] prompt = function prompt() { [native code] }
|–[function] pt = function pt(myExp){ document.getElementById(“dbg”).innerHTML+=”
“+myExp+” “+eval(myExp)+””; }
|–[function] put = function put(myStr){ document.getElementById(“dbg”).innerHTML+=”
“+myStr+””; }
|–[function] removeEventListener = function removeEventListener() { [native code] }
|–[function] requestAnimationFrame = function requestAnimationFrame() { [native code] }
|–[function] resizeBy = function resizeBy() { [native code] }
|–[function] resizeTo = function resizeTo() { [native code] }
|–[object] screen
|–[number] screenLeft = 0
|–[number] screenTop = 79
|–[number] screenX = -3
|–[number] screenY = -3
|–[function] scroll = function scroll() { [native code] }
|–[function] scrollBy = function scrollBy() { [native code] }
|–[function] scrollTo = function scrollTo() { [native code] }
|–[object] self
|–[undefined] sessionStorage = undefined
|–[function] setImmediate = function setImmediate() { [native code] }
|–[function] setInterval = function setInterval() { [native code] }
|–[function] setTimeout = function setTimeout() { [native code] }
|–[function] showHelp = function showHelp() { [native code] }
|–[function] showModalDialog = function showModalDialog() { [native code] }
|–[function] showModelessDialog = function showModelessDialog() { [native code] }
|–[function] showObject = function showObject(myObjectName){ var myObject = eval(myObjectName); var objArray = new Array(); // 儲存物件成員名稱 var typename = null; //儲存物件成員型別 try { // 將物件成員放入陣列 for(var tmpObj in myObject) { if((myObject.hasOwnProperty && myObject.hasOwnProperty(tmpObj))||!(tmpObj===”undefined”)){ objArray[objArray.length++] = tmpObj; } } put(“”);//輸出,美化 put(“[Object] “+myObjectName+””);//輸出 if(objArray.length===0) { put(“物件沒有成員”);//輸出 return; } //對陣列進行排序 objArray.sort(); for(var k=0;k”+objArray[k]+””);//輸出 } else { put(” |–[“+typename+”] “+objArray[k]+” = “+myObject[objArray[k]]);//輸出 } } } catch (e) { alert(“輸入的不是物件”); } }
|–[string] status =
|–[object] styleMedia
|–[function] toStaticHTML = function toStaticHTML() { [native code] }
|–[function] toString = function toString() { [native code] }
|–[object] top
|–[object] window
本文轉自 hexiaini235 51CTO部落格,原文連結:http://blog.51cto.com/idata/1103417,如需轉載請自行聯絡原作者
相關文章
- JavaScript window物件JavaScript物件
- JavaScript window 物件JavaScript物件
- JavaScript中的Window物件(開啟新的視窗)JavaScript物件
- JavaScript 複習之 window物件JavaScript物件
- 快來圍觀一下JavaScript的ProxyJavaScript
- javascript中的棧結構JavaScript
- JavaScript中的程式結構和分支結構JavaScript
- JavaScript客戶端document物件和window物件的區別JavaScript客戶端物件
- 關於JavaScript中this的指向,你知曉幾分?請速來圍觀!JavaScript
- JavaScript 中的 資料結構JavaScript資料結構
- JavaScript Window---瀏覽器物件模型JavaScript瀏覽器物件模型
- JavaScript學習4:BOM之window物件JavaScript物件
- Javascript 物件導向中的建構函式和原型物件JavaScript物件函式原型
- JS中陣列物件的基本結構JS陣列物件
- Javascript解析之this代表物件及作用範圍JavaScript物件
- javascript閉包—圍觀大神如何解釋閉包JavaScript
- JavaScript中的樹型資料結構JavaScript資料結構
- JavaScript中textRange物件使用方法總結JavaScript物件
- JavaScript中的Array物件JavaScript物件
- javascript中的連結串列結構—雙向連結串列JavaScript
- JavaScript 中物件解構時指定預設值JavaScript物件
- JavaScript WindowJavaScript
- TypeScript 中限制物件鍵名的取值範圍TypeScript物件
- JavaScript中物件的拷貝JavaScript物件
- javascript中window.$是什麼意思JavaScript
- JavaScript中的幾種資料結構簡介JavaScript資料結構
- 結構性外觀模式.模式
- Redis - 物件結構Redis物件
- 深入瞭解JavaScript中的物件JavaScript物件
- Javascript中的陣列物件排序JavaScript陣列物件排序
- JavaScript 中物件的深拷貝JavaScript物件
- JavaScript中的物件導向----類JavaScript物件
- 詳解Javascript中的Object物件JavaScriptObject物件
- javascript的物件問題及總結JavaScript物件
- JavaScript 物件解構賦值JavaScript物件賦值
- Stack and Queue in JavaScript(Javascript中的資料結構之棧和佇列)JavaScript資料結構佇列
- android UI結構 (1)Activity 與 WindowAndroidUI
- 【資料結構之巨集觀總結 】資料結構