用window.open打开的窗口中,有时候session变量会丢掉,给asp编程带来的一定的麻烦。用参数传递解决它:
<DIV id=cus_table style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; OVERFLOW: scroll; BORDER-LEFT: #000000 1px solid; WIDTH: 450px; BORDER-BOTTOM: #000000 1px solid; HEIGHT: 150px; BACKGROUND-COLOR: #ffffff"
open函数,放在<head和</head之间
<script language="javascript"
<!--
function openwindow(par,hang,lie,mterm,mweek,mlabname)
{
var pp,bhang,blie,req_week,req_term;
pp=par;
bhang=hang;
blie=lie;
req_week=mweek;
req_term=mterm;
req_labname=mlabname; window.open('iptinfo.asp?qinqiu='+pp+'&qhang='+bhang+'&qlie='+blie+'&req_week='+req_week+'&req_term='+req_term+'&req_labname='+req_labname,'请输入相关信息','height=200, width=320, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
}
--
</script
函数的调用,放在你想到的地方,我这儿是用onclick触发
<a href=# onclick=openwindow('<%=session("teachername")%','<%=(bhang+2)/4%','<%=blie-1%','<%=lnd_term%','<%=lnd_week%','<%=sek_labname%')预约</a
</div
那么在iptinfo.asp里面就可以用request(“qinqiu“)获得session变量的值,其它参数一样,可由request得到,不过据说在参数传递时url不能超过255,我好像超过了也没出错提示:(