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

推荐订阅源

cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
B
Blog RSS Feed
宝玉的分享
宝玉的分享
腾讯CDC
博客园_首页
T
Tailwind CSS Blog
月光博客
月光博客
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
M
MIT News - Artificial intelligence
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
大猫的无限游戏
大猫的无限游戏
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
SecWiki News
SecWiki News
美团技术团队
P
Privacy International News Feed
H
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
Know Your Adversary
Know Your Adversary
Y
Y Combinator Blog
D
DataBreaches.Net
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
S
Schneier on Security
G
GRAHAM CLULEY
博客园 - 三生石上(FineUI控件)
Cisco Talos Blog
Cisco Talos Blog
小众软件
小众软件
Forbes - Security
Forbes - Security
D
Docker
T
Tenable Blog
S
Secure Thoughts
雷峰网
雷峰网
S
Security @ Cisco Blogs
T
The Exploit Database - CXSecurity.com
The Cloudflare Blog
博客园 - 【当耐特】
Spread Privacy
Spread Privacy
阮一峰的网络日志
阮一峰的网络日志

博客园 - 雨中流泪

轻量的PHP开发框架--- litePhp Rails 命令大全 ObjectHTML Framework 0.0.9.1 for PHP 发布.欢迎试用 在学习中沉沦... 在Dom4j中使用xpath - 雨中流泪 - 博客园 Spring.Net + NHibernate 入门例子 - 雨中流泪 使用Spring 2.5 和 Hibernate 3.2 开发MVC Web程序(基于annotation特性) PHP函数收藏---不断更新中! - 雨中流泪 - 博客园 程序员的编辑器--EmEditor 自己写的一个JS组件,JCombo 0.9 - 雨中流泪 - 博客园 Enterprise Library 3.1的研究之路---Data Access Application Block(1) 发个"违法"的东西.VisualAssist X 1559破解版 自己写的Log日志记录类,支持文件和数据库,自动建立Log表格 (三)AJAXPro之旅---原理的探究 - 雨中流泪 - 博客园 (二)AJAXPro之旅---构造实际的AJAX应用. (一)AJAXPro之旅---神奇的小魔盒 Windows Live Writer Grove,.Net下最方便的O/R Map库 ASP.Net分页组件1.0开发下载了...
我的AJAX类的使用(一个简单的异步组件)
雨中流泪 · 2007-09-05 · via 博客园 - 雨中流泪

这个组件可以异步加载网页文件,需要我前面写的那个AJAX的组件支持!.

其组件代码AJAXDiv.js的源码 

function $(objid)
{
    
return document.getElementById(objid);
}


function $$(tagname)
{
    
return document.getElementsByTagName(tagname);
}


function AJAXDiv(objid,autoFix,loadclass)
{
    
//alert(objid);
    this._id=objid;
    
this._loadClass=loadclass;
    
this._autoFix=autoFix;
    
this.init=function()
    
{
        
var obj=$(this._id);
        
if((this._loadClass!=null)&&(this._loadClass!=""))
        
{
            obj.className
=this._loadClass;
        }

        
var ajaxLib=new AJAXLib();
        ajaxLib.method
="get";
        ajaxLib.URLString
=obj.rl;
        ajaxLib.onCompletion
=function()
        
{
            
//alert(ajaxLib.response);
            obj.innerHTML=ajaxLib.response;
        }

        ajaxLib.onLoading
=function()
        
{
            obj.innerHTML
="<span class="fixie"></span><img src='loading.gif'>正在初始化...";
        }

        ajaxLib.onLoaded
=function()
        
{
            obj.innerHTML
="<span class="fixie"></span><img src='loading.gif'>初始化完毕...";
        }

        ajaxLib.onInteractive
=function()
        
{
            obj.innerHTML
="<span class="fixie"></span><img src='loading.gif'>正在解析响应...";
        }

        ajaxLib.Send();
        
if(this._autoFix)
        
{
            obj.style.overflow
="visible";
        }

        
else
        
{
            obj.style.overflow
="scroll";
        }

    }
;
    
this.init();
}

测试文件test.htm:

<html>
<head>
    
<link href="main.css" rel="stylesheet" rev="stylesheet">
    
<script language="javascript" src="AJAXLib.js"></script>
    
<script language="javascript" src="AJAXDiv.js"></script>
    
<script language="javascript">
        window.onload
=function()
        
{
            
var ad=new AJAXDiv("ajaxdiv1",false);
            
var ad2=new AJAXDiv("ajaxdiv2",true)
        }

    
</script>
</head>
<body>
    
<div class="ajaxdiv" id="ajaxdiv1" rl="a1.htm">
    
</div>
    
<div class="ajaxdiv" id="ajaxdiv2" rl="a2.htm">
    
</div>
</body>
</html>

这样就可以异步加载网页文件了,而且有加载进度提示.