<div id="newphotos">数据载入中……</div>
<script language="JavaScript">
function getXML(URL){
if (window.XMLHttpRequest) { var xmlhttp = new XMLHttpRequest();
} else { var MSXML = ['MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP']; for(var n = 0; n < MSXML.length; n ++) { try
{ var xmlhttp = new ActiveXObject(MSXML[n]); break; } catch(e) { } } } xmlhttp.Open("GET", URL, false); try{
xmlhttp.Send(); var result = xmlhttp.status; } catch(e){ return(false); } if(result==200){ newphotos.innerHTML=unescape(xmlhttp.responseText); } var xmlhttp = null;
}
function update(){ getXML('ajaxserver/newphoto.asp?placeid=<%= placeid %>&placecityid<%= placecityid %>'); }
setInterval("update()",1000);
</script>
asp文件
newphoto.asp
<!--#include file="include.asp" --> <% placeid=Request("placeid") placecityid=Request("placecityid")
xmlhttp="" xmlhttp=xmlhttp&"<table width=""99%"" height=""149"" border=""0"" align=""right"" cellpadding=""3"" cellspacing=""0"" class=""fuangkuanghs"">"&chr(13) xmlhttp=xmlhttp&"<tr>"&chr(13) xmlhttp=xmlhttp&"<td valign=""top""><table width=""100%"" border=""0""
cellpadding=""0"" cellspacing=""0"">"&chr(13) xmlhttp=xmlhttp&"<tr>"&chr(13) xmlhttp=xmlhttp&"<td height=""20"" align=""left"" class=""textblue""><table width=""396"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&chr(13) xmlhttp=xmlhttp&"<tr>"&chr(13)
xmlhttp=xmlhttp&" <td width=""65%""><a href=""http://www.jiluyisheng.com/photo.asp?placeid="&placeid&"&placecityid="&placecityid&"""><img src=""images/index/index_01.jpg""
width=""349"" height=""23"" border=""0""></a></td>"&chr(13) xmlhttp=xmlhttp&"<td width=""35%""><a href=""http://www.jiluyisheng.com/photo.asp?placeid="&placeid&"&placecityid="&placecityid&""" target=""_self""><img
src=""images/index/index_02.jpg"" width=""47"" height=""23"" border=""0""></a></td>"&chr(13) xmlhttp=xmlhttp&"</tr>"&chr(13) xmlhttp=xmlhttp&"</table>"&chr(13) xmlhttp=xmlhttp&"</td>"&chr(13) xmlhttp=xmlhttp&"</tr>"&chr(13) xmlhttp=xmlhttp&"<tr>"&chr(13) xmlhttp=xmlhttp&"<td
valign=""top""><table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">"&chr(13) xmlhttp=xmlhttp&"<tr>"&chr(13) set rs=userconn.execute("select top 3 weburl,photo_name,Photo_smallimg,idx_photo,jiuid,hits from v_jiphoto where weburl<>'' and
iflag=2 and priv=1 "&where_str&" order by idx_photo desc") 'set rs=userconn.execute("select top 5 * from jiphoto where weburl<>'' and systype=5 order by idx_photo desc") if not rs.eof then
do while not rs.eof weburl=rs("weburl") if weburl<>"" then web= Replace(weburl,"http://","") picurl=weburl&"/Uploadfile/"&web& "/Photo/smallimg/" & rs("Photo_smallimg") else picurl="images/h3.gif" end if xmlhttp=xmlhttp&"<td height=""25""
align=""center""><table width=""99%"" border=""0"" cellpadding=""0"" cellspacing=""0"">"&chr(13) xmlhttp=xmlhttp&"<tr>"&chr(13) xmlhttp=xmlhttp&"<td height=""12"" align=""center""><table width=""123"" height=""93"" border=""1"" cellpadding=""3"" cellspacing=""0""
bordercolor=""#cccccc"" style=""BORDER-COLLAPSE: collapse"">"&chr(13) xmlhttp=xmlhttp&"<tr>"&chr(13) xmlhttp=xmlhttp&"<td width=""123"" height=""93"" align=""center""><a target=blank href="&weburl&"/photo.asp?idx_photo="&rs("idx_photo")&"&jiuid="&rs("jiuid")&"><img
src="&picurl&" onload=""javascript:DrawImage(this,115,67)"" alt=""点击看大图"" width=""115"" height=""67"" border=""0""/></a> </td>"&chr(13) xmlhttp=xmlhttp&"</tr>"&chr(13) xmlhttp=xmlhttp&"</table>"&chr(13) xmlhttp=xmlhttp&"</td>"&chr(13) xmlhttp=xmlhttp&"</tr>"&chr(13)
xmlhttp=xmlhttp&"<tr>"&chr(13) xmlhttp=xmlhttp&"<td height=""12"" align=""center"">"&FilterString(Rs("photo_name"),9)&"("& Rs("hits")&"/"&P.Get_RsCount(userconn,"[JiPhoto_reply]","idx_Photo="&rs("idx_photo"))&")</td>"&chr(13) xmlhttp=xmlhttp&"</tr>"&chr(13)
xmlhttp=xmlhttp&"</table></td>"&chr(13) Rs.MoveNext loop end if rs.close() set rs=nothing xmlhttp=xmlhttp&"</tr>"&chr(13) xmlhttp=xmlhttp&"</table></td>"&chr(13) xmlhttp=xmlhttp&"</tr>"&chr(13) xmlhttp=xmlhttp&"</table></td>"&chr(13) xmlhttp=xmlhttp&"</tr>"&chr(13)
xmlhttp=xmlhttp&"</table>"&chr(13) Response.write(escape(xmlhttp)) %>
分享到:
相关推荐
简单代码实现ASP+AJAX+ACCESS无刷新请求功能实现,实用新手了解
实现了获取评论无刷新,发表评论无刷新,www.sendawangluo.com页面获取评论时显示loading加载效果jquery真的是一个非常优秀的JS库,简单容易掌握,对于网页中的多级菜单、级联效果、Tab选项卡切换、图片轮转显示,...
ASP实例开发源码—ASP+Ajax 不刷新网页加载新闻列表示例代码.zip
资源是用asp写的,因为正好在做这么一个案例。可以写成其他语言。主要是ajax根据ID传参实现无刷新点击加载页面效果。
纯用javascript实现的ajax三级联动无刷新,数据传送采用json格式,开发平台采用vs2010 asp.net,压缩包含有sql脚本
ASP 结合Ajax 不刷新网页 加载新闻列表示例 ASP 结合Ajax 不刷新网页 加载新闻列表示例
asp+AJAX MP3音乐播放系统,只要输入歌曲名,就会自动播放音乐...一款运用Ajax技术设计的MP3音乐盒,运行于ASP环境,ajax技术的加入,实现了页面的无刷新加载音乐地址及歌词,可无刷新删除音乐列表,记忆最近试听列表等
ASP源码,压缩包解压密码:www.cqlsoft.com
ASP环境下实现无刷新查询程序,基于xml+ajax技术,程序使用Access数据库,查询速度很快,输入关键字提交后在下面显示查询结果。另外程序还包括一个XML读取的程序。
原理:页面载入时,jQuery向后台请求数据,ASP程序通过查询数据库将最新的几条记录显示在列表页,在列表页的底部有个“更多”链接,通过触发该链接,向服务端发送Ajax请求,后台ASP程序接收请求参数,并作出相应,...
Ajax无刷新加载新闻列表,新闻列表由ASP从Access数据库中读出,当前页面中,当鼠标滑向某链接时,会激活Ajax动作,读取对应的文章列表,本示例是学习Ajax技术的基础 ,对于Asp编程者应用ajax技术很有帮助作用。
1、Ajax 无刷新页面的好处:提供良好的客户体验,通过 Ajax 在后台从数据库中取得数据并展示,取缔了等待加载页面而出现的空白状态; 2、那么,Ajax 无刷新页面是运行在动态页面(.php)?还是静态页面(....
Asp.net Ajax UpdatePanel.Triggers 属性 属性值 类型:System.Web.UI..::.UpdatePanelTriggerCollection 类型为 AsyncPostBackTrigger 和 PostBackTrigger 的对象的集合。 AsyncPostBackTrigger 类 定义一个控件,...
传统的聊天室基于客户端网页的自动刷新技术而实现,它的主要缺点是不断刷新页面造成屏幕的闪动,而经过了Ajax改造后的聊天室,每次只获取最新的发言信息,并将获取结果动态写入页面,不会有以上的缺点 ………………...
当滚动条滚道最底端,无刷新加载数据,asp+jQuery+json实现!
Ajax 树形菜单,选择加载,不选择不加载
自做asp图片管理系统类,似网易图片浏览页面ajax+image无刷新图片缓存预加载可以键盘操作浏览,附加数据库,安装persits.jpeg组件。用户名admin密码admin
ASP+jQuery+JSON无刷新加载更多内容,我们在一些腾讯网站评论栏目上可以看到这样的应用,列表没有使用分页条,而是一次加载一定数量的记录显示在列表页,当用户浏览到列表页底部时,可以通过单击“加载更多”来查看...
内容索引:ASP源码,Ajax相关,Ajax,无刷新,ASP分页程序 本程序是一个ASP运用Ajax进行无刷新分页的示例,使用了Access数据库,没有用到AJAX框架。实际上它的这种无刷新只是用JavaScript去实现的,而且实现的方法也不...
基于ASP的Ajax 不刷新网页加载新闻列表示例代码.zip