我需要知道文檔元素是否爲頁面的ROOT節點。例如:檢查文檔是否爲ROOT節點
<html> <-- ROOT Node
<head></head>
<body>
<iframe>
<html>...</html> <-- other document
</iframe>
<iframe>
<html>...</html> <-- other document
</iframe>
</body>
</html>
在iframe 1或2中執行的Javascript應該知道它們的文檔節點是否是根節點。
希望你能幫助我。
+1節點,但`top.document ===窗口.document`已經足夠,`window.top`只是一個較慢的方法來做'top' – 2011-02-04 09:22:30