如何让JS新窗口打开

<script language="javascript" src="article/list.asp?num=30&classid=3"></script>这一段JS 显示出来的内容他是在当前页打开的。怎么才能让他实现在新窗口打开。

下面是文件list.asp的代码,看下怎么改
javastr=""
javastr=javastr+"<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
<!--#include file="conn.asp" -->
<%
num=Request.QueryString("num")
if num="" then
num=10
end if
classid=Request.QueryString("classid")
if classid<>"" then
sql="select top "&num&" * from article where lanmuid="&classid&" order by id desc"
else
sql="select top "&num&" * from article order by id desc"
end if

set rs=conn.execute(sql)
do while not rs.eof
%>
javastr=javastr+"<tr><td>"
<%
title=rs("title")
title=replace(title,"<","<")
title=replace(title,">",">")
title=replace(title,vbCrlf,"<br>")
title2=left(title,30) '设置显示10个字符
if len(title2)<>len(title) then
title2=title2&"......"
end if
if classid="" then
%>
javastr=javastr+"[<%=rs("date")%>]<a href=article.asp?id=<%=rs("id")%>&classid=<%=rs("lanmuid")%>><%=title%></a>"

<%else
%>
javastr=javastr+"<%=rs("date")%>.</td><td><a href=article.asp?id=<%=rs("id")%>&classid=<%=classid%> title=\"<%=title%>\" ><%=title2%></a>"
<%end if%>
javastr=javastr+"</td></tr>"
<%rs.movenext
loop%>
javastr=javastr+"</table>"
document.write(javastr)
<%rs.close%>
不对啊
最新回答
你的剧情像迷途

2024-10-31 07:53:02

将JS代码保存为“.js”文件,然后在新页面头文件中引用可以,引用代码:
<script language="javascript" src="***/***.js" charset="UTF-8"></script>