问题补充,此页面的功能相当于 dreamveaver MX  的工作界面,  窗口右边的小窗口可以通过点击小三角号而打开或关闭, 它的判断条件就是 document.all  我大概知道 all 是说所有的对象,   但点击三角号时,  什么时候是 all  什么情况下不是all  呢? 请帮忙!

解决方案 »

  1.   

    all--------------------------------------------------------------------------------DescriptionReturns an object reference to the collection of elements contained by the object. Syntax
    object.all(index)Parameter Description 
    object  An object that can contain elements such as the document.  
    (index)  Optional. An integer or a string specifying the index value of the element to retrieve. Integer indexes are zero-based, meaning the first element in the collection has index 0. A string index is valid only if the string is a name or identifier of at least one element in the document. ResThe all collection includes one element object for each valid HTML tag. If a valid tag has a matching end tag, both tags are represented by the same element object. The collection returned by the document's all property always includes a reference to the HTML, HEAD, TITLE, and BODY objects regardless of whether the tags are present in the document. If the document contains invalid or unknown tags, the collection includes one element object for each. Unlike valid end tags, unknown end tags are represented by their own element objects. The order of the element objects is the HTML source order. Although the collection indicates the order of tags, it does not indicate hierarchy. ExamplesThe following JScript example displays the names of all tags in the document in the order the tags appear in the document. for(i=0; i<document.all.length; i++) {
        alert(document.all(i).tagName);
    }The following JScript example uses the item method on the all collection to retrieve all element objects for which the name or ID attribute is set to "sample". Depending on how many times the name or ID is defined in the document, the item method may return null, a single element object, or a collection of element objects. The example uses the length property of the collection to determine whether item returned a collection or a single object. var a = document.all.item("sample");
    if (a!=null) {
        if (a.length!=null) {
            for (i=0; i<a.length; i++) {
                alert(a(i).tagName);
            }
        } else 
            alert(a.tagName);
    } Propertylength Methodsitem, tags Applies ToA, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IFRAME, IMG, INPUT, INS, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, OBJECT, OL, P, PLAINTEXT, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XMP 
      

  2.   

    在这里是起到判断是否是ie的功能,
    if(document.all)  //ie
    if(document.layer) //ns