我需要知道文档元素是否为页面的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