下面这个asp代码怎么写成js代码,实现调用
<styletype="text/css"><!--body{margin-left:0px;margin-top:0px;margin-right:0px;margin...
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<table width="98%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td width="322" height="30" align="center" bgcolor="#e7e7e7"><div align="center"><strong>课程名</strong></div></td>
<td width="95" align="center" bgcolor="#e7e7e7"><strong>主讲</strong></td>
<td width="150" align="center" bgcolor="#e7e7e7"><strong>考试币(人民币)</strong></td>
<td width="95" align="center" bgcolor="#e7e7e7"><strong>试听</strong></td>
</tr>
<%
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 %>
<tr>
<td height="30" class="biankuan3">
·<a href='/class/qss.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank"><font color="004475"><%= Left(rs("productclass_Name"),26) %></font></a> </td>
<td class="biankuan3">
<div align="center"><%= Left(rs("productclass_Man"),18) %></div> </td>
<td align="center" class="biankuan3">
<font color="FF6500"><%= Left(rs("productclass_Money"),18) %><%= rs("productclass_RMB")%> <img src="../test/image/img28.gif" width="12" height="12" /></font> </td>
<td class="biankuan3">
<a href="/class/viewpsok1.asp?classid=<%= rs("productclass_ID") %>" title="<%= rs("productclass_Name") %>" target="Blank">
<div align="center"><img src="/class/image/img16.gif" width="29" height="15" border="0" /></div>
</a> </td>
</tr>
<% else %>
<tr>
<td height="30" class="biankuan3">
·<a href='/class/dianti.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank"><font color="004475"><%= Left(rs("productclass_Name"),26) %></font></a> </td>
<td class="biankuan3">
<div align="center"><%= Left(rs("productclass_Man"),18) %></div> </td>
<td align="center" class="biankuan3">
<font color="FF6500"><%= Left(rs("productclass_Money"),18) %><%= rs("productclass_RMB")%><img src="../test/image/img28.gif" width="12" height="12" /></font> </td>
<td class="biankuan3">
<a href='/class/dianti.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank">
<div align="center"><img src="/class/image/img16.gif" width="29" height="15" border="0" /></div>
</a> </td>
</tr>
<% end if %>
<%
rs.movenext
loop
end If
rs.close
Set rs=Nothing
%>
</table>
是ASP转为JS代码,然后用<script language="javascript" src="11.asp"></script>调到HTML页面上面 展开
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<table width="98%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td width="322" height="30" align="center" bgcolor="#e7e7e7"><div align="center"><strong>课程名</strong></div></td>
<td width="95" align="center" bgcolor="#e7e7e7"><strong>主讲</strong></td>
<td width="150" align="center" bgcolor="#e7e7e7"><strong>考试币(人民币)</strong></td>
<td width="95" align="center" bgcolor="#e7e7e7"><strong>试听</strong></td>
</tr>
<%
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 %>
<tr>
<td height="30" class="biankuan3">
·<a href='/class/qss.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank"><font color="004475"><%= Left(rs("productclass_Name"),26) %></font></a> </td>
<td class="biankuan3">
<div align="center"><%= Left(rs("productclass_Man"),18) %></div> </td>
<td align="center" class="biankuan3">
<font color="FF6500"><%= Left(rs("productclass_Money"),18) %><%= rs("productclass_RMB")%> <img src="../test/image/img28.gif" width="12" height="12" /></font> </td>
<td class="biankuan3">
<a href="/class/viewpsok1.asp?classid=<%= rs("productclass_ID") %>" title="<%= rs("productclass_Name") %>" target="Blank">
<div align="center"><img src="/class/image/img16.gif" width="29" height="15" border="0" /></div>
</a> </td>
</tr>
<% else %>
<tr>
<td height="30" class="biankuan3">
·<a href='/class/dianti.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank"><font color="004475"><%= Left(rs("productclass_Name"),26) %></font></a> </td>
<td class="biankuan3">
<div align="center"><%= Left(rs("productclass_Man"),18) %></div> </td>
<td align="center" class="biankuan3">
<font color="FF6500"><%= Left(rs("productclass_Money"),18) %><%= rs("productclass_RMB")%><img src="../test/image/img28.gif" width="12" height="12" /></font> </td>
<td class="biankuan3">
<a href='/class/dianti.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank">
<div align="center"><img src="/class/image/img16.gif" width="29" height="15" border="0" /></div>
</a> </td>
</tr>
<% end if %>
<%
rs.movenext
loop
end If
rs.close
Set rs=Nothing
%>
</table>
是ASP转为JS代码,然后用<script language="javascript" src="11.asp"></script>调到HTML页面上面 展开
展开全部
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 %>
<tr>
<td height="30" class="biankuan3">
·<a href='/class/qss.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank"><font color="004475"><%= Left(rs("productclass_Name"),26) %></font></a> </td>
<td class="biankuan3">
<div align="center"><%= Left(rs("productclass_Man"),18) %></div> </td>
<td align="center" class="biankuan3">
<font color="FF6500"><%= Left(rs("productclass_Money"),18) %><%= rs("productclass_RMB")%> <img src="../test/image/img28.gif" width="12" height="12" /></font> </td>
<td class="biankuan3">
<a href="/class/viewpsok1.asp?classid=<%= rs("productclass_ID") %>" title="<%= rs("productclass_Name") %>" target="Blank">
<div align="center"><img src="/class/image/img16.gif" width="29" height="15" border="0" /></div>
</a> </td>
</tr>
<% else %>
<tr>
<td height="30" class="biankuan3">
·<a href='/class/dianti.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank"><font color="004475"><%= Left(rs("productclass_Name"),26) %></font></a> </td>
<td class="biankuan3">
<div align="center"><%= Left(rs("productclass_Man"),18) %></div> </td>
<td align="center" class="biankuan3">
<font color="FF6500"><%= Left(rs("productclass_Money"),18) %><%= rs("productclass_RMB")%><img src="../test/image/img28.gif" width="12" height="12" /></font> </td>
<td class="biankuan3">
<a href='/class/dianti.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank">
<div align="center"><img src="/class/image/img16.gif" width="29" height="15" border="0" /></div>
</a> </td>
</tr>
<% end if %>
<%
rs.movenext
loop
end If
rs.close
Set rs=Nothing
%>
)
------------------------------
我可是收费的
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 %>
<tr>
<td height="30" class="biankuan3">
·<a href='/class/qss.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank"><font color="004475"><%= Left(rs("productclass_Name"),26) %></font></a> </td>
<td class="biankuan3">
<div align="center"><%= Left(rs("productclass_Man"),18) %></div> </td>
<td align="center" class="biankuan3">
<font color="FF6500"><%= Left(rs("productclass_Money"),18) %><%= rs("productclass_RMB")%> <img src="../test/image/img28.gif" width="12" height="12" /></font> </td>
<td class="biankuan3">
<a href="/class/viewpsok1.asp?classid=<%= rs("productclass_ID") %>" title="<%= rs("productclass_Name") %>" target="Blank">
<div align="center"><img src="/class/image/img16.gif" width="29" height="15" border="0" /></div>
</a> </td>
</tr>
<% else %>
<tr>
<td height="30" class="biankuan3">
·<a href='/class/dianti.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank"><font color="004475"><%= Left(rs("productclass_Name"),26) %></font></a> </td>
<td class="biankuan3">
<div align="center"><%= Left(rs("productclass_Man"),18) %></div> </td>
<td align="center" class="biankuan3">
<font color="FF6500"><%= Left(rs("productclass_Money"),18) %><%= rs("productclass_RMB")%><img src="../test/image/img28.gif" width="12" height="12" /></font> </td>
<td class="biankuan3">
<a href='/class/dianti.asp?classid=<%= rs("productclass_ID") %>' title="<%= rs("productclass_Name") %>" target="Blank">
<div align="center"><img src="/class/image/img16.gif" width="29" height="15" border="0" /></div>
</a> </td>
</tr>
<% end if %>
<%
rs.movenext
loop
end If
rs.close
Set rs=Nothing
%>
)
------------------------------
我可是收费的
展开全部
把html代码用也转换成asp的代码形式,然后,赋值给一个变量,用
document.write("<%=变量%>"),调用,完毕。
document.write("<%=变量%>"),调用,完毕。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
asp 也能直接调用
在需要加载的地方
<!--#include file="调用的页面"-->
在需要加载的地方
<!--#include file="调用的页面"-->
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询