利用Microsoft.XMLHTTP定制页面无刷新自动检索提示信息
2006-10-26 08:59
459 查看
页面脚本:
var guid = "null";
function CheckMessage()
{
var obj = guid;
var nn = Math.floor( Math.random() * 2000000);
//显示信息页面
var url = "MessageInfo.aspx?time="+nn+"&code=";
if(obj != "null")
{
url = url + obj;
guid = "null";
OpenPasswordWin(url,300,500);
document.getElementById("divMessage").innerHTML = "";
}
}
//检查是否有新的消息
function YouHadNewMessage(){
var Had = false;
//空白执行检索页面
url = "CheckMessage.aspx";
var nn = Math.floor( Math.random() * 2000000);
url += "?time="+nn;
var httpRequest;
if (typeof XMLHttpRequest != 'undefined') {
httpRequest = new XMLHttpRequest();
}
else if (typeof ActiveXObject != 'undefined') {
httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
}
if (httpRequest) {
httpRequest.open('GET', url, false);
httpRequest.send(null);
if(httpRequest.status == 200){
var textInfo = httpRequest.responseText;
if(textInfo != "null") Had = true;
}}
if(Had){
guid = textInfo;
document.getElementById("divMessage").innerHTML = "<a href='#' title='查看站内短信' onclick='CheckMessage()' id='ss7'><font color=white>-</font></a><bgsound src='/images/newMessage.wav' border='0'>";
}
else
{
document.getElementById("divMessage").innerHTML = "";
}
setTimeout("YouHadNewMessage()",300000);
}
setTimeout("YouHadNewMessage()",300000);
var guid = "null";
function CheckMessage()
{
var obj = guid;
var nn = Math.floor( Math.random() * 2000000);
//显示信息页面
var url = "MessageInfo.aspx?time="+nn+"&code=";
if(obj != "null")
{
url = url + obj;
guid = "null";
OpenPasswordWin(url,300,500);
document.getElementById("divMessage").innerHTML = "";
}
}
//检查是否有新的消息
function YouHadNewMessage(){
var Had = false;
//空白执行检索页面
url = "CheckMessage.aspx";
var nn = Math.floor( Math.random() * 2000000);
url += "?time="+nn;
var httpRequest;
if (typeof XMLHttpRequest != 'undefined') {
httpRequest = new XMLHttpRequest();
}
else if (typeof ActiveXObject != 'undefined') {
httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
}
if (httpRequest) {
httpRequest.open('GET', url, false);
httpRequest.send(null);
if(httpRequest.status == 200){
var textInfo = httpRequest.responseText;
if(textInfo != "null") Had = true;
}}
if(Had){
guid = textInfo;
document.getElementById("divMessage").innerHTML = "<a href='#' title='查看站内短信' onclick='CheckMessage()' id='ss7'><font color=white>-</font></a><bgsound src='/images/newMessage.wav' border='0'>";
}
else
{
document.getElementById("divMessage").innerHTML = "";
}
setTimeout("YouHadNewMessage()",300000);
}
setTimeout("YouHadNewMessage()",300000);
相关文章推荐
- 利用Microsoft.XMLHTTP定制页面无刷新自动检索提示信息
- 利用Microsoft.XMLHTTP定制页面无刷新自动检索提示信息
- 利用Microsoft.XMLHTTP实现无刷新查询
- 利用xmlhttp无刷新自动实时更新数据
- 利用Microsoft.XMLHTTP实现无刷新查询
- 利用js实现对页面的自动刷新
- vs提示项目刷新失败,无法从服务器中检索文件夹信息
- 利用Microsoft.XMLHTTP控件发送COOKIE
- Android搭建环境和android工程基本信息;android的xml代码自动提示功能
- 利用Microsoft.XMLHTTP和Microsoft.XMLDOM实现xml文件的读取
- HttpClient和HtmlParser配合实现自动CAS单点登录系统抽取页面信息
- HttpClient和HtmlParser配合实现自动登陆系统抽取页面信息
- HttpClient和HtmlParser配合实现自动登陆系统抽取页面信息
- xmlhttp页面无刷新实现
- HttpClient和HtmlParser配合实现自动登陆系统抽取页面信息
- HttpClient和HtmlParser配合实现自动登陆系统抽取页面信息
- 利用XML不离开页面刷新数据
- 利用js实现对页面的自动刷新
- XMLHttpRequest无刷新更新页面
- 两种Web页面局部刷新技术IFRAME与XmlHttpRequest