zoukankan      html  css  js  c++  java
  • 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);
    }
  • 相关阅读:
    UVA 120 Stacks of Flapjacks
    HDU 4869 Turn the pokers
    HDU 4882 ZCC Loves Codefires
    HDU 4864 Task
    HDU 4861 Couple doubi
    UVA 1600 Patrol Robot
    UVA 712 S-Trees
    2014/4/6长沙多校第六次(浙大校赛)
    UVA10905 思维考察
    HDU1498 枚举+二分图类棋盘问题(最大匹配)
  • 原文地址:https://www.cnblogs.com/cry/p/1309558.html
Copyright © 2011-2022 走看看