asp问题:在新窗口打开链接

来源:百度知道 编辑:UC知道 时间:2024/05/04 08:28:26
response.Write " <a href='http://" & rsKehu("url") &" ', 'newwindow', 'height=450, width=400, toolbar=no, menubar=no, scrollbars=auto, resizable=no, location=no, status=no')"" title='" & rsKehu("url") & "'><font color='#FF0000'>" &rsKehu("title") & "</font></a>"

我要在新窗口中打开链接,代码应该加在哪里?
sub ShowKehu(KehuNum)
dim sqlKehu,rsKehu,i
if KehuNum>0 and KehuNum<=50 then
sqlKehu="select top " & KehuNum
else
sqlKehu="select top 50"
end if
sqlKehu=sqlKehu & " * from kehu order by ID Desc"
Set rsKehu= Server.CreateObject("ADODB.Recordset")
rsKehu.open sqlKehu,conn,1,1
if rsKehu.bof and rsKehu.eof then
KehuCount=0
response.write "<p>  没有客户信息</p>"
else
KehuCount=rsKehu.rec

把下面的代码加到你的页里
<script language="javascript">
function openNewWin(url)
{
newWin=open(url,"newWindow","height=450, width=400, toolbar=no, menubar=no, scrollbars=auto, resizable=no, location=no, status=no");
}
</script>
然后修改
response.Write " <a href='http://" & rsKehu("url") &" ', 'newwindow', 'height=450, width=400, toolbar=no, menubar=no, scrollbars=auto, resizable=no, location=no, status=no')"" title='" & rsKehu("url") & "'><font size='2' color='#FF0000'>" &rsKehu("title") & "</font></a><br>"
改成
response.Write("<a href='javascript:openNewWin("""&rsKehu("url") &""");title='" & rsKehu("url") & "'><font size='2' color='#FF0000'>&quo