ASP+Ajax實(shí)現(xiàn)無刷新評論簡單例子
更新時間:2007年07月03日 00:00:00 作者:
<!--#include file="command.asp" -->
<%
Dim CurPage
CurPage=cint(Request("page"))
If CurPage = empty or CurPage<1 Then
CurPage = 1
End If
Response.ContentType="application/xml"
Response.Charset="gb2312"
Response.Expires=0
Response.Write("<?xml version=""1.0"" encoding=""gb2312""?>")
Dim rs,Sql '定義連接數(shù)據(jù)庫對象
Set rs=Server.CreateObject("ADODB.Recordset")
Sql="SELECT * From rev Order by id Desc"
rs.Open Sql,Conn,1,3
IF rs.Eof And rs.Bof Then
Response.Write("<data page=""0"" P_Nums=""0"">")
Response.Write("<Content>沒有留言</Content>")
Response.Write("</data>")
Response.End
Else
Dim PerPage,P_Nums,PageCountN,D_Nums
PerPage=3
Rs.PageSize=PerPage
Rs.AbsolutePage=CurPage
P_Nums=Rs.PageCount
D_Nums=Rs.RecordCount
Response.Write("<data page="""&CurPage&""" P_Nums="""&P_Nums&""" D_Nums="""&D_Nums&""">")
Do Until rs.EOF or PageCountN=PerPage
Response.Write("<Author PostTime="""&formatTime(rs("PostTime"))&"""><![CDATA["&rs("memContent")&"]]></Author>")
Response.Write("<Content><![CDATA["&rs("memContent")&"]]></Content>")
rs.MoveNext
PageCountN=PageCountN+1
Loop
End If
Response.Write("</data>")
%>
打包文件下載
<%
Dim CurPage
CurPage=cint(Request("page"))
If CurPage = empty or CurPage<1 Then
CurPage = 1
End If
Response.ContentType="application/xml"
Response.Charset="gb2312"
Response.Expires=0
Response.Write("<?xml version=""1.0"" encoding=""gb2312""?>")
Dim rs,Sql '定義連接數(shù)據(jù)庫對象
Set rs=Server.CreateObject("ADODB.Recordset")
Sql="SELECT * From rev Order by id Desc"
rs.Open Sql,Conn,1,3
IF rs.Eof And rs.Bof Then
Response.Write("<data page=""0"" P_Nums=""0"">")
Response.Write("<Content>沒有留言</Content>")
Response.Write("</data>")
Response.End
Else
Dim PerPage,P_Nums,PageCountN,D_Nums
PerPage=3
Rs.PageSize=PerPage
Rs.AbsolutePage=CurPage
P_Nums=Rs.PageCount
D_Nums=Rs.RecordCount
Response.Write("<data page="""&CurPage&""" P_Nums="""&P_Nums&""" D_Nums="""&D_Nums&""">")
Do Until rs.EOF or PageCountN=PerPage
Response.Write("<Author PostTime="""&formatTime(rs("PostTime"))&"""><![CDATA["&rs("memContent")&"]]></Author>")
Response.Write("<Content><![CDATA["&rs("memContent")&"]]></Content>")
rs.MoveNext
PageCountN=PageCountN+1
Loop
End If
Response.Write("</data>")
%>
打包文件下載
相關(guān)文章
AJAX+JSP實(shí)現(xiàn)讀取XML內(nèi)容并按排列顯示輸出的方法示例
這篇文章主要介紹了AJAX+JSP實(shí)現(xiàn)讀取XML內(nèi)容并按排列顯示輸出的方法,結(jié)合實(shí)例形式分析了ajax與后臺jsp頁面交互實(shí)現(xiàn)xml內(nèi)容的排列輸出相關(guān)操作技巧,需要的朋友可以參考下2018-06-06IE瀏覽器與FF瀏覽器關(guān)于Ajax傳遞參數(shù)值為中文時的區(qū)別實(shí)例分析
這篇文章主要介紹了IE瀏覽器與FF瀏覽器關(guān)于Ajax傳遞參數(shù)值為中文時的區(qū)別,結(jié)合實(shí)例分析說明了ajax參數(shù)傳遞過程中的參數(shù)轉(zhuǎn)碼相關(guān)注意事項(xiàng)與使用技巧,需要的朋友可以參考下2015-12-12ajax 實(shí)現(xiàn)微信網(wǎng)頁授權(quán)登錄的方法
這篇文章主要介紹了ajax 實(shí)現(xiàn)微信網(wǎng)頁授權(quán)登錄的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-03-03聊一聊數(shù)據(jù)請求中Ajax、Fetch及Axios的區(qū)別
axios、fetch和ajax的區(qū)別在網(wǎng)絡(luò)上存在很多文章,下面這篇文章也是給大家介紹了關(guān)于數(shù)據(jù)請求中Ajax、Fetch及Axios區(qū)別的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-02-02