下面这个asp代码怎么写成js代码,实现调用

2025-04-19 19:38:54
推荐回答(3个)
回答1:

document.write(<%

set rs=Server.CreateObject("adodb.recordset")
sql="select top 10 * from [productclass] where ProductClass_Type_ID=54 order by productclass_ID desc"
rs.open sql,conn,1,1
if not rs.eof Then

do while not rs.eof

%>

<% if rs("productclass_KeType") = 0 then %>



·' title="<%= rs("productclass_Name") %>" target="Blank"><%= Left(rs("productclass_Name"),26) %>

<%= Left(rs("productclass_Man"),18) %>


<%= Left(rs("productclass_Money"),18) %><%= rs("productclass_RMB")%>

" title="<%= rs("productclass_Name") %>" target="Blank">




<% else %>



·' title="<%= rs("productclass_Name") %>" target="Blank"><%= Left(rs("productclass_Name"),26) %>

<%= Left(rs("productclass_Man"),18) %>


<%= Left(rs("productclass_Money"),18) %><%= rs("productclass_RMB")%>

' title="<%= rs("productclass_Name") %>" target="Blank">




<% end if %>

<%
rs.movenext
loop

end If
rs.close
Set rs=Nothing

%>
)
------------------------------
我可是收费的

回答2:

把html代码用也转换成asp的代码形式,然后,赋值给一个变量,用
document.write("<%=变量%>"),调用,完毕。

回答3:

asp 也能直接调用

在需要加载的地方