惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 小小小程序员

转载 gridview在绑定显示的各种格式 - 小小小程序员 - 博客园 转 ASP.NET 2.0中OWC生成柱状图和饼状图的源代码 - 小小小程序员 同一个ASP站点UTF-8和GB2312的两个子站点乱码的解决方法 - 小小小程序员 转 ASP.NET 页面事件执行顺序 转 用 Javascript 验证表单(form)中的单选(radio)值 - 小小小程序员 转 .net里如何判断中文字符长度 转CSDN Sybase PowerDesigner专区 转 ASP.net中的Server.UrlEncode函数和ASP中的Server.URLEncode函数返回的值竟然不一样!!!! DIV实现下拉菜单 转 .NET 2.0 SqlDependency快速上手指南 转 SqlServer 2005 报表批量自动部署 转 SQL Server 2005中设置Reporting Services发布web报表的匿名访问 - 小小小程序员 div 属性 OBJECTPROPERTY函数使用 转 数字金额大小写转换之存储过程 转 PowerDesigner教程系列 - 小小小程序员 [转载]ASP.NET 格式化字符串 转 VS.NE类、变量、文件命名规范 - 小小小程序员 转 MVC在Web系统中的模式与应用
使用XMLHTTP 获取服务器数据,实现无刷新效果
小小小程序员 · 2007-08-24 · via 博客园 - 小小小程序员

<script language="javascript">
var http_request = false;
function send_request(url)
{//初始化、指定处理函数、发送请求的函数
http_request = false;
//开始初始化XMLHttpRequest对象
if(window.XMLHttpRequest) { //Mozilla 浏览器
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType)
{//设置MiME类别
http_request.overrideMimeType('text/xml');
}
}
else if (window.ActiveXObject)
{ // IE浏览器
try
{
http_request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{}
}
}
if (!http_request) { // 异常,创建对象实例失败
window.alert("不能创建XMLHttpRequest对象实例.");
return false;
}
http_request.onreadystatechange = processRequest;
// 确定发送请求的方式和URL以及是否同步执行下段代码
http_request.open("Get", url, false);
http_request.send(null);
}

// 处理返回信息的函数

function processRequest()
{
if (http_request.readyState == 4)
{ // 判断对象状态

if (http_request.status == 200)
{ // 信息已经成功返回,开始处理信息
//alert("您有新的消息需要处理。");
var strTemp = http_request.responseText;
var nint = -1;
nint = strTemp.indexOf("*");
if ( nint != -1)
{
 pop();//显示弹出框表示有新消息
}
document.getElementById("ieslider").innerHTML = strTemp;
 }
 else
 { //页面不正常
alert("您所请求的页面有异常。");
 }
}
}
function userCheck()
{
send_request('RefurbishNews.aspx');
}
//第一次执行

function MyShow()
{
//2秒自动刷新一次,2秒取得一次数据
timer = window.setInterval("userCheck()",60000);
}

</script>