下面是我全部的代码: 我想实现当点击表格中间一行是,调用showing()函数,问题是,调用函数以后,图片也出来了,但是把原来的表格给覆盖掉了.这是为什么?
test.asp
*****************************************
<html>
<head>
<title>图片显示</title>
<style type="text/css">
<!--
body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR:black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }
A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active { font: 9pt "宋体"; cursor: hand; color: #FF0033 }
a.cc:hover { font: 9pt "宋体"; cursor: hand; color: #FF0033}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#fef4d9">
<SCRIPT language=javascript>
function showing() {
document.write("<style>")
document.write(".box { font: 9pt '宋体'; position: absolute; background: #ffffff }")
document.write("</style>")
document.write("<table width='100' height='100' border='0' cellpadding='0' cellspacing='0' class='box' id='itemopen' style='display:none'>")
document.write("<tr><td><img src='showing.asp' width='100' height='100'></td></tr> ")
document.write("</table>")
newX = window.event.x + document.body.scrollLeft
newY = window.event.y + document.body.scrollTop
menu = document.all.itemopen
if ( menu.style.display == ""){
menu.style.display = "none" }
else {
menu.style.display = ""}
menu.style.pixelLeft = newX + 50
menu.style.pixelTop = newY
}
</SCRIPT>
<table width="44%" height="173" border="1" align="center" cellpadding="1" cellspacing="1">
<tr>
<td> </td>
</tr>
<tr>
<td align="center" onClick="showing()"> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</body>
</html>
******************************************************
showing.asp
*****************************************************
<!--#include file="share/Conn.asp" -->
<%
set rec=server.createobject("ADODB.recordset")
sql="select picture from kqxxb where mkid=100502"
rec.open sql,conn
Response.ContentType="image/*"
Response.BinaryWrite rec("picture").getChunk(7500000)
rec.close
set rec=nothing
set conn=nothing
%>
showing.asp是为了实现从数据中调用二进制图片. 测试是可以找个图片代替
[此贴子已经被作者于2006-1-10 11:38:50编辑过]