检查dom节点是否为文档。
noder.isDoc(node)
Example:判断元素 p 是否属于文档元素,alert结果。
<!DOCTYPE html> <html> <head> <style> </style> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.3/require.min.js"></script> <script> require.config({ baseUrl: "./", packages: [{ name: "skylark", location: "../../../src/skylark" }, ] }); </script> </head> <body> <p>Hello</p> <script> require(["skylark/finder", "skylark/noder"], function(finder, noder) { alert(noder.isDoc(finder.find("p"))); }); </script> </body> </html>