我想实现用iframe控制网页,让网页不刷新,可是显示有问题?

来源:百度知道 编辑:UC知道 时间:2024/06/25 04:42:16
代码如下:
<html>
<head>
<title></title>
<script language="JavaScript" type="text/javascript">
function init() {
var fullFileName = window.opener.document.getElementById("fileName").value;
window.document.forms[0].fileName.value = fullFileName;
//document.title = fullFileName;
document.title = "title111";

window.document.forms[0].submit();
}

</script>
</head>
<body onload="init()">
<iframe name=iframe1 width="100%" height="100%" marginLeft ="0" frameborder="0" marginheight="0" marginwidth="0"
hspace="0" vspace="0"
></iframe>
<form action="../download" method="get" target="iframe1">
<input type="hidden" name="serviceName" value=&

加个CSS控制一下:

<html>
<head>
<title></title>
<script language="JavaScript" type="text/javascript">
function init() { }
</script>

<style type="text/css">
<!--
* {padding:0;margin:0;}
-->
</style>
</head>
<body onLoad="init()">
<iframe name=iframe1 width="100%" height="100%" marginLeft ="0" frameborder="0" marginheight="0" marginwidth="0"
hspace="0" vspace="0" ></iframe>
<form action="../download" method="get" target="iframe1">
<input type="hidden" name="serviceName" value="reportDownLoad">
<input type="hidden" name="fileName">
</form>
</body>
</html><