在页面的<body></body>中插入以下代码:
<script src ="height.js"></script>其中height.js内容为:
document.body.onload = jxh;
function jxh()
...{
window.clipboardData.setData('text',String('frameHeight='+document.body.scrollHeight));
}
本文介绍了一种使用JavaScript自动获取网页主体部分高度的方法,并通过将结果复制到剪贴板来方便进一步使用。具体实现是定义了一个名为jxh的函数,该函数利用document.body.scrollHeight属性来获取高度。
在页面的<body></body>中插入以下代码:
<script src ="height.js"></script>其中height.js内容为:
document.body.onload = jxh;
function jxh()
...{
window.clipboardData.setData('text',String('frameHeight='+document.body.scrollHeight));
}
329
274
6565
902
192

被折叠的 条评论
为什么被折叠?