All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
asp.net判断文件或文件夹是否存在_[Asp.Net教程]
PHP,开发中的中文编码问题_php资料_编程技术
PHP中数组元素升序、降序及重新排序的函数_php资料_编程技术
C#教程:C#数据类型之装箱和拆箱
如何构造一个C#语言的爬虫程序_[Asp.Net教程]
Visual,Studio,2008,Professional,简体中文RTM版,体验(1)_[Asp.Net教程]
PEAR简介_php资料_编程技术
构建安全的Xml,Web,Service系列(三)_[Asp.Net教程]
asp.net,URL重写(URLRewriter),之简化版_.net资料_编程技术
SQL SERVER与ACCESS、EXCEL的数据转换_[SQL Server教程]
Reading number is top 10 pictures
中国的十元人民币的秘密
So beauty, will let you spray blood2
Chinese paper-cut grilles art appreciation7
小学生作文又现神作,你不得不佩服
六种更聪明的工作方法
Sora aoi on twitter5
清纯性感的美眉2
Summer is most suitable for young people to travel in China4
Look at the Spring Festival people crowded into the what kind
Seductive beauty of crime2
Download software ranking
Love the forty days
C#与.NET技术平台实战演练
Wild things 2
Kung fu panda - the secret of the teacher
Unix video tutorial4
Tram sex maniac 2 (H) rar bag19
双旗镇刀客A
VC++6.0简体中文版
Be there or be square
功夫熊猫2(上集)
aaa published in(发表于) 2013/12/18 8:07:36 Edit(编辑)
使用AJAX技术实现网页无闪自动局部刷新_.net资料_编程技术

使用AJAX技术实现网页无闪自动局部刷新_.net资料_编程技术

使用AJAX技术实现网页无闪自动局部刷新_.net资料_编程技术-你的首页-uuhomepage.com

我们在网页制作的过程中经常会遇到及时刷新数据的问题,如果使用 的方法,会造成整个屏幕不断闪烁刷新的效果,这会降低用户的操作满意度。


所以我们需要一种可以实现无闪自动刷新数据的方法来解决以上问题。


实例解决问题:


希望实现用户在进入系统以后(整个session的时效之内),如果收到新邮件则发出声音提示。


实现思路:


1.首页部分:


< body onload="init('');"> // load时调用init(user);


2.js部分:用XMLHTTP实现页面局部刷新,调用check_mail.jsp对后台数据库进行检索判断并返回结果。




3.check_mail.jsp


<%@ page contentType="text/html; charset=GBK" %>
<%@ page errorPage="error/login_error.jsp"%>
<%@ page import="myweb.*" %>
<%@ page import="java.sql.*" %>
<%
String user=request.getParameter("uName");
Connection conn=null;
try{
conn=DBConnection.getConnection();
PreparedStatement pStat=conn.divpareStatement("
select * from message where r_name='"+user+"' and status=0");
ResultSet rs=pStat.executeQuery();
if(rs.next()){//有记录
response.getWriter().print(0);
}else{
response.getWriter().print(1);
}
}finally{
if(conn!=null) conn.close();
}
%>


4.首页结果显示


将< span id="test1" > < /span >插入指定位置。





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.