async 属性

Definition and Usage
定义和用法

The async property specifies whether downloading of an XML file should be handled asynchronously or not.
async属性的作用是:指定XML文件的下载是否与XML的处理异步进行。

True means that the load() method returns the control to the caller before the download is complete.
这意味着load()方法必须在下载结束之前将控制指令返回给请求对象。

False means that the download must be completed before the caller gets the control back.
False意味着下载必须在请求对象取回控制指令之前完成。

Syntax
语法

documentObject.async


Example
案例

In nearly all our examples, we have used the books.xml file and the JavaScript function loadXMLDoc(). The loadXMLDoc() function uses the async property:
在我们的大部分案例中,我们都使用了“books.xml”文件以及JavaScript 函数“loadXMLDoc()”。“loadXMLDoc()” 函数使用的是async[异步]属性:

function loadXMLDoc(dname) 
{
var xmlDoc;
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
            xmlDoc.async=false;
xmlDoc.load(dname);
return(xmlDoc);
}

转载于:https://www.cnblogs.com/cry/archive/2008/10/12/1309558.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值