求助,为什么以下代码编程出来的四个按钮没有用,按钮的编码在a2.html中
a1.html
<html>
<head>
<title>实验五:框架和图像</title>
</head>
<frameset cols="30%,*">
<frame src="a2.html" name="info">
<frameset rows="50%,*">
<frame src="a3.html" name="result1">
<frame src="a4.html" name="result2">
</frameset>
</frameset>
</html>
a2.html
<html>
<head>
<title>左框架</title>
<script language="JavaScript">
function cV(s)
{var len=s.length;
for(var i=0;i<len;i++)
{if(s.charAt(i)!="")
{
return ture;
}
}
return false;
}
function setPicture1()
{var pictureURL=""
if(cV(document.infor.fp.value))
{pictureURL=document.infor.fp.value;}
else
{pictureURL="t1.jpg";}
window.parent.result1.document.showPicture1.src=pictureURL;
}
function setPicture2()
{var pictureURL=""
if(cV(document.infor.sp.value))
{pictureURL=document.infor.sp.value;}
else
{pictureURL="t2.jpg";}
window.parent.result2.document.showPicture2.src=pictureURL;
}
function cancelHandle()
{
window.parent.info.document.infor.fp.value="";
window.parent.info.document.infor.sp.value="";
}
function closeWindow()
{
var flag=window.confirm("您确定要关闭当前页面吗?");
if flag==ture
{
window.parent.close();
}
}
</script>
</head>
<body>
<h3>信息显示框架</h3>
<form name="infor">
<font size=2>要展示的第一个图像文件:</font>
<br>
<input type="input" name="fp" size=30>
<input type="button" name="sfp" value="展示" onClick="setPicture1()">
<br>
<font size=2>要展示的第二个图像文件:</font>
<br>
<input type="input" name="sp" size=30>
<input type="button" name="ssp" value="展示" onClick="setPicture2()">
<br>
<input type="button" name="qvxiao" value="取消" onClick="cancelHandle()">
<input type="button" name="guanbi" value="关闭窗体" onClick="closeWindow()">
</form>
</body>
</html>
a3.html
<html>
<head>
<title>图像显示页面</title>
</head>
<body>
<h3> 这个页面用来显示第一幅图</h3>
<img src="t1.jpg" name="showPicture1" border=5 hspace=15 vspace=0 width=320 height=240>
</body>
</html>
a4.html
<html>
<head>
<title>图像显示页面</title>
</head>
<body>
<h3> 这个页面用来显示第二幅图</h3>
<img src="t2.jpg" name="showPicture2" border=5 hspace=15 vspace=0 width=320 height=240>
</body>
</html>