Small knowledge (1)

Source: Internet
Author: User

DOM structure--what relationships may exist between two nodes and how to move between nodes arbitrarily.

Dom operations-How to add, remove, move, copy, create, and find nodes.
Features/methods Type/return type Description
NodeName String The name of the node, as defined by the type of the node
NodeValue String The value of the node, as defined by the type of the node
NodeType Number One of the type constant values of the node
Ownerdocument Document Point to the document to which this node belongs
FirstChild Node Point to the first node in the ChildNodes list
LastChild Node Point to the last node in the ChildNodes list
ChildNodes NodeList List of all child nodes
PreviousSibling Node Point to the previous sibling node; If the node is the first sibling node, the value is null
NextSibling Node Point to the latter sibling node; if the node is the last sibling node, the value is null
HasChildNodes () Boolean When childnodes contains one or more nodes, it returns a true
Attributes NamedNodeMap A attr object that contains the attributes representing an element; only for ELEMENT nodes
AppendChild (node) Node Add node to the end of ChildNodes
RemoveChild (node) Node Remove node from childnodes
ReplaceChild (Newnode,oldnode) Node Replace OldNode in childnodes with NewNode
InsertBefore (Newnode,refnode) Node Insert Newnodd before refnode in ChildNodes

element Node node Type value (NodeType)
Elemental Element 1
Property attr 2
Textual text 3
Comment Comments 8
Document documents 9
events-How to use events and what are the main differences between the IE and DOM event models.
Already havexmlhttprequest--What this is, how to perform a GET request completely, and how to detect the error.
XMLHTTP is a set of APIs that accept XML or other data through the HTTP protocol, enabling asynchronous interaction

VarxmlHTTP;
functionLoadxmldoc(Url)
{
xmlHTTP=Null;
If (Window.XMLHttpRequest)
{Code for all new browsers
xmlHTTP=new XMLHttpRequest();
}
Else If (Window.ActiveXObject)
{Code for IE5 and IE6
xmlHTTP=new ActiveXObject("Microsoft.XMLHTTP");
}
If (xmlHTTP!=Null)
{
xmlHTTP.onReadyStateChange=State_change;
xmlHTTP.Open("GET",Url,True);
xmlHTTP.Send(Null);
}
Else
{
Alert("Your Browser does not support XMLHTTP.");
}
}

functionState_change()
{
If (xmlHTTP.ReadyState==4)
{//4 = "Loaded"
if< Span class= "PLN" > (xmlhttp. Status==200)
{< Span class= "com" >//= OK
//... our code here ...
}
else
Span class= "pun" >{
Alert ( "problem retrieving XML data" Span class= "pun");
}
}
} /span>

The meaning of the readyState value of XMLHTTP:

    • 0-uninitialized, that is, open has not been called.
    • 1-Initialize, that is, send has not been called.
    • 2-Sends the data, that is, send is already called.
    • 3-in data transfer.
    • 4-Done.

Strict mode and promiscuous mode--how to trigger these two patterns, what is the point of distinguishing them.
adding an XML header can trigger the IE browser's quirks mode, and after triggering, the browser will parse like IE5.5, with IE5.5 bugs and other problems, as well as behavior (Javascript).  triggering of the IE6adding XML declarations before XHTML DOCTYPE<?xml version= "1.0" encoding= "Utf-8"?><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > triggering of the IE7adding HTML annotations between XML declarations and XHTML doctype <?xml version= "1.0" encoding= "Utf-8"?><!--... and keep IE7 in quirks mode --<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > both IE6 and IE7 can trigger.Add HTML Annotations to the HTML4.01 DOCTYPE document header <!--quirks Mode --<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD" > Box Model--the relationship between margins, padding, and borders, and how the box model differs in browsers with the following versions of IE 8. Mainly IE8 the height and width of the box model below contains the padding border
block-level elements and inline elements-how to control them with CSS, how they affect the surrounding elements, and how you think they should be defined. Already have
floating elements--how to use them, what their problems are, and how to solve these problems. Already have

What is the difference between HTML and xhtml--, and what do you think should be used and why? Xhtml:1 to have a good Layout 2 label must be lowercase to the end of the empty label should also use a slash ending 3 must have a property name and in quotation marks 4 do not use the ID or the Name property 5 if you use strict mode many of the appearance of the label will not be allowed with XHTML reason 1 extensibility, There is development 2 conforms to the standard professional 3 support new tour equipment 4 data fusion with XML goodjson--What it is, why it should be used, how to use it, and say the implementation details. JavaScript Objects notation (JavaScript object Notation) JSON is smaller, faster, and easier to parse than XML. You can use JSON like an object

Get element Position Size

Browser size clientwidth clientheight scrollwidth scrollheight scrolltop scrollleft element offsetwidth offsetHeight scrollWidth ScrollHeight scrolltop scrollleftoffsettop offsetleft

Small knowledge (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.