前台:
<head>
<script type="text/javascript" src="../js/apply.js"></script>
</head>
<iframe width="100%" height="100%" id="mainFrame" name="mainFrame" frameborder="0"
οnlοad="javascript:SetCwinHeight(this);" marginheight="0" marginwidth="0" scrolling="auto"
align="middle" src="<%=aaa%>"></iframe>
apply.js页面:
function SetCwinHeight(obj) {
var Iframe1 = obj;
if (document.getElementById) {
if (Iframe1 && !window.opera) {
if (Iframe1.contentDocument && Iframe1.contentDocument.body.offsetHeight)
Iframe1.height = Iframe1.contentDocument.body.offsetHeight+20; //FF NS
else if (Iframe1.Document && Iframe1.Document.body.scrollHeight)
Iframe1.height = Iframe1.Document.body.scrollHeight + 10; //IE
}
else {
if (Iframe1.contentWindow.document && Iframe1.contentWindow.document.body.scrollHeight) {
Iframe1.height = Iframe1.contentWindow.document.body.scrollHeight; //Opera
}
}
}
}
function printPage()
{
print();
}