為什么第二個高度顯示為34
<!DOCTYPE?HTML> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8">? </head> <body> <script?type="text/javascript"> document.write(document.body.scrollHeight+"?") document.write(document.body.scrollWidth+"<br/>") document.write(document.documentElement.scrollHeight+"?") document.write(document.documentElement.scrollWidth) </script> </body>???? </html>
2016-08-03
document.body是DOM中Document對象里的body節(jié)點, document.documentElement是文檔對象根節(jié)點(html)。