67,550
社区成员




<input type="button" name="Button" value="Button"
onclick="document.frames('ifrmname').location.reload()">
OR
<input type="button" name="Button" value="Button"
onclick="document.all.ifrmname.document.location.reload()">
OR
用iframe的id属性定位
<input type="button" name="Button" value="Button"
onclick="ifrmid.window.location.reload()">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function iframe2aa()
{
var frame = document.getElementById("ifame");
frame.src = "a.html";
}
function iframe2bb()
{
var frame = document.getElementById("ifame");
frame.src = "b.html";
}
</script>
</head>
<body>
<input type="button" value="button_aa" onclick="iframe2aa()">
<input type="button" value="button_bb" onclick="iframe2bb()">
<iframe width="100%" height="450"
src="a.html"
frameborder="0" id="ifame"
name="ifame" scrolling="no">
</iframe>
</body>
</html>
<html>
<head>
<title>Untitled</title>
</head>
<script type="text/javascript">
function iframe2aa(u)
{
document.getElementById("ifameid").src = u ;
}
function iframe2bb(u)
{
document.getElementById("ifameid").src = u ;
}
</script>
<body>
<table>
<tr>
<td>
<input type="button" value="button_aa" onclick="iframe2aa('aa.htm')">
<input type="button" value="button_bb" onclick="iframe2bb('bb.htm')">
<iframe width="100%" height="450"
src=""
frameborder="0" id="ifameid"
name="ifame" scrolling="no">
</iframe>
</td>
</tr>
</table>
</body>
</html>