这是子页的代码:<table width="600" height="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<script>
function hnusr(obj)
{
alert(obj);
}
</script>
<td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<%for i=1 to 20%>
<td align="center"><img src="../Images/Pic/<%=i%>.gif" width="75" height="85" id="Pic1" onclick="hnusr(Pic1.src);"/></td>
<%
if i mod 5=0 then response.write "<tr>"
next%>
</tr>
</table></td>
</tr>
</table>
<tr>
<script>
function hnusr(obj)
{
alert(obj);
}
</script>
<td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<%for i=1 to 20%>
<td align="center"><img src="../Images/Pic/<%=i%>.gif" width="75" height="85" id="Pic1" onclick="hnusr(Pic1.src);"/></td>
<%
if i mod 5=0 then response.write "<tr>"
next%>
</tr>
</table></td>
</tr>
</table>
<script>
function hnusr(str)
{
window.opener.document.all.pic.src=str;
window.opener.document.all.pic1.value=str;
window.close()
}
</script>
还有一点点小问题,就是文本框里得到的地址是这样的:
http://localhost/Images/Pic/9.gif
我只想返回来的是/Images/Pic/9.gif
就行了,因为绝对路径放在数据库里不会出错.