这是子页的代码:<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>

解决方案 »

  1.   

    子窗口:<img onclick="window.opener.document.all.pic.src=this.src;window.opener.document.all.pic1.value=this.src;window.close()" src="xxx.gif"><img onclick="window.opener.document.all.pic.src=this.src;window.opener.document.all.pic1.value=this.src;window.close()" src="xxx.gif"><img onclick="window.opener.document.all.pic.src=this.src;window.opener.document.all.pic1.value=this.src;window.close()" src="xxx.gif">
      

  2.   

    <td align="center"><img src="../Images/Pic/<%=i%>.gif" width="75" height="85" id="Pic1" onclick="hnusr(Pic1.src);"/></td>改为    <td align="center"><img src="../Images/Pic/<%=i%>.gif" width="75" height="85" id="Pic1" onclick="hnusr(this.src);"/></td>
    <script>
    function hnusr(str)
    {
    window.opener.document.all.pic.src=str;
    window.opener.document.all.pic1.value=str;
    window.close()
    }
    </script>
      

  3.   

    哇,你真是超级牛人,俺真的好佩服你哇.
    还有一点点小问题,就是文本框里得到的地址是这样的:
    http://localhost/Images/Pic/9.gif
    我只想返回来的是/Images/Pic/9.gif
    就行了,因为绝对路径放在数据库里不会出错.
      

  4.   

    你在后台得到Request变量,可以找到Serername + 端口信息的。替换掉即可