ASP 变量传递问题

来源:百度知道 编辑:UC知道 时间:2024/06/25 08:40:39
请教ID=caidan的层中链接"查看资料"***.ASP?ID= 应该怎么写?
代码如下:
<script language="JavaScript">
function you(){
caidan.style.posLeft= document.body.scrollLeft+event.x-30
caidan.style.posTop= document.body.scrollTop+event.y+10
caidan.style.display="inline"
return false }
document.onclick=function(){

if(document.activeElement!=caidan)
caidan.style.display="none"
}

</script>

<%
set rs=server.createobject("adodb.recordset")
sql="select * from userinfo "
rs.open sql,conn,1,1
if rs.eof then
response.Write"没有用户"
else
%>
<%for j=1 to 100
If rs.EOF Then Exit For
%>
<table border="1" width="100">
<tr oncontextmenu="you('<%=rs("id")%>')">
<td &g

function you(){
改成
function you(id){
caidan.innerHTML=caidan.innerHTML.replace('{ID}',id);

<a href="***.asp?id=请教">
换成
a href="***.asp?id={ID}">

你查看的资料要放在循环里啊
<%
set rs=server.createobject("adodb.recordset")
sql="select * from userinfo "
rs.open sql,conn,1,1
if rs.eof then
response.Write"没有用户"
else
%>
<%for j=1 to 100
If rs.EOF Then Exit For
%>
<table border="1" width="100">
<tr oncontextmenu="you('<%=rs("id")%>')">
<td ><%=rs("username")%></td>
</tr>

</table>
<span id="caidan" style="border:1px solid #666666;background:#eeeeee;width:68px;padding:5px;display:none;position:absolute; left:384px; top:30px">
<div><fo