转:各浏览器获取iframe内容方法以及调试结果

转自:http://ouyo.info/show.php?pid=1838

iframe.contentWindow.document

     ->iframe.contentWindow.document.documentElement

          ->iframe.contentWindow.document.documentElement.textContent  (W3)

          ->iframe.contentWindow.document.documentElement.innerText   (IE)

     ->iframe.contentWindow.document.XMLDocument

          ->iframe.contentWindow.document.XMLDocument.text

 

 

 

 

contentWindow.document

>.documentElement

>>.textContent

>>.innerText

>.XMLDocument

>>.text

Trident

 

 

 

 

 

 

 

 

 

ie6

 

[object]

[object]

undefined

content

[object]

content

 

ie7

 

 

 

 

 

 

 

 

 

maxthon

[object]

[object]

undefined

content

[object]

content

 

 

360se

[object]

[object]

undefined

content

[object]

bug

 

 

原生

 

 

 

 

 

 

 

ie8

 

[object HTMLDocument]

[object HTMLHtmlElement]

undefined

content

[object]

content

 

ie9

 

[object Document]

[object Element]

content

undefined

undefined

×

gecko

 

 

[object XMLDocument]

[object Element]

content

undefined

undefined

×

webkit

 

 

 [object Document]

[object Element]

content

undefined

undefined

×

presto

 

 

[object XMLDocument]

[object Element]

content

undefined

undefined

×

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(iframe,浏览器)