<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title></title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <link href="styles/publicDefine.css" rel="stylesheet" type="text/css" /> </head> <script type="text/javascript"> function setLoadHeight(){ if(!isNaN(window.clipboardData.getData('text'))){ parent.document.all("jpkc").style.height = window.clipboardData.getData('text'); } else{setTimeout("setLoadHeight()",1000)} } </script> <body onLoad="setLoadHeight();"> <iframe id="jpkc" name="jpkc" src='http://192.168.1.199/jpkc' frameborder='0' marginwidth='0' marginheight='0' width='100%' scrolling='no'></iframe> </body> </html>
被调用页面的关键代码:
<body onload="window.clipboardData.setData('text',String(window.document.body.scrollHeight));">
以上这种方法只适用于IE浏览器,而且有个不足之处:就是遇到一些安全性较好的操作系统(如:win2003)会弹出“是否允许从剪切板上粘贴内容”的对话框。