On the jquery selector and DOM operation
jquery Selector
1. Basic Selector
The base selector is the most commonly used selector in jquery, and the simplest selector, which looks for DOM elements through the element ID, class, and tag name. This is very important, the following content is based on this, progressive improvement.
1). " $ ("#id"), gets the element specified by ID, and the ID is globally uni
1. Dom of browserBrowsers often require DOM implementations and JAVASCRIPT implementations to remain independent of each otherWhat does this mean for performance? Simply put, two separate sections with a functional interface can lead to performance loss. A very figurative metaphor is to think of DOM as an island, and JavaScript (ECMAScript) as another island , co
JavaScript consists of three parts: ECMAScript, BOM, and Dom1. Core--ecmascript: Provide core language functions2. Document Object Model--dom: Provides methods and interfaces for accessing and manipulating Web page contentAn application Programming interface (API) for XML but extended for HTML.The DOM maps the page into a multi-layered node structure.Why use the DOM
The jquery object is the object that is generated after the DOM object is wrapped through jquery. jquery objects are unique to jquery, which can use the methods in jquery, but cannot use DOM methods, such as: $ ("#img"). attr ("src", "test.jpg"); The $ ("#img") here is the JQuery object.
Dom objects are some of the object operations inherent to JavaScript.
JavaScript HTML DOMThrough the HTML DOM, you can access all the elements of a JavaScript HTML document.HTML DOM (Document Object model)When a Web page is loaded, the browser creates a Document object model for the page.With the programmable object model, JavaScript has the ability to create dynamic HTML.JavaScript can change all HTML elements in a pageJavaScript can change all HTML attributes in a pageJavaS
?
First, you create a DOMDocument object$dom = new DOMDocument ();Then load the XML file$dom-> Load ("Test.xml");
Output XML fileHeader ("content-type:text/xml;charset=gb2312");echo $dom-> savexml ();
Save an XML file with a return value of int (file size, in bytes)$dom-> Save ("Newfile.xml");
echo "$titles = $
Trinity's Web pageStructure layer: Created by markup language such as HTML or XHTML;Presentation layer: The CSS is responsible for the completion;Behavior layer: The issue of how content should respond to events. This is the domain dominated by the JavaScript language and Dom.SeparationUse (X) HTML to build the structure of the document;Use CSS to set the rendering effect of the document;Using DOM scripting to implement the behavior of the document;Ho
Before discussing the mutual exchange of jquery objects and Dom objects, agree on the style of defining variables. If you get an object that is a jquery object, add $ before the variable, for example:
Copy Code code as follows:
var $variable = jquery object;
If you get a DOM object, it is defined as follows:
Copy Code code as follows:
var variable =
jquery Selector1. Basic SelectorThe basic selector is the most commonly used selector in jquery and the simplest selector, which finds DOM elements by element ID, class, and tag name. This is very important, the following content is based on this, the gradual improvement.1). " $ ("#id"), gets the ID of the specified element, the ID is globally unique, so it has only one member.2). " $ (". Class") ", gets the element specified by class, the different e
Before we start, Dom is very easy to understand, but it's so official that it's hard to understand and we translate it in very simple language. Deepen the understanding of the DOM and thus have a comprehensive understanding of it.what is Dom The full name of the DOM is Document Object model, which allows scripts to con
In the development of JavaScript programs, you often use a number of frequently triggered DOM events, such as MouseMove, resize, and not so commonly used mouse wheel events: MouseWheel (in Firefox, the wheel event is Dommousescroll )。
browser in order to ensure that these events can respond in a timely manner, the trigger frequency will be higher, the specific trigger frequency of the browser, although there are discrepancies, but not very much. Most
Dom|xml, preface
There are two most common ways to parse XML documents in Java: Using the event-based XML Simple API (simply API for XML), called Sax and the Document object model based on the tree and node, is called Dom. Sun offers Java API for XML parsing (JAXP) interfaces to use Sax and Dom, and with JAXP, we can use any of the JAXP-compliant XML parsers.
Th
In the first study of jquery, it is often impossible to distinguish between DOM objects and jquery objects, so let's take a brief look at the relationships and differences between them.
1.DOM Object (Document object Model)
Document Object model, each DOM can be represented as a tree, for example, the following is a simple page code:
Represents the
Dom object:Document Object model, which can be represented as a tree by each part of the DOM.As shown, the code is omittedIn this DOM tree, H3, P, UL, and UL's 3 Li subnodes are all DOM element nodes.Get DOM object:// get DOM Object var domobj = document.getElementById ("ID"
disadvantage that if you register events with the Select, all of these events will be lost, and you will have to code to re-register the events.
New nodes are added before and after the specified node, which is related to node positioning, node creation, and setting of node properties. Using innerHTML is usually used only to overwrite all nodes of a DOM element, if you want to change only one of the element's subnodes, or
Before you discuss, make an appointment to define the style of the variable.If you get an object that is a jquery object, add $ before the variable, for example:
Copy Code code as follows:
var $variable = jquery object;
If you get a DOM object, it is defined as follows:
Copy Code code as follows:
var variable = dom object;
jquery objects cannot use methods
Mutual conversion of jquery objects and Dom objects
Before discussing the mutual conversion of jquery objects and Dom objects, agree on the style of defining variables. If you get a jquery object, precede the variable with $, such as
var $varible = jquery object;
If you get a DOM object, it is defined as follows:
var varible =
This article mainly describes the jquery object and JS in the DOM object conversion between the method, so that the jquery object can be used directly in the JS method, or JS Dom object using the method in jquery.jquery objects and Dom objects are not the same, what is a jquery object? What is a DOM object? Let us give
Maybe you'll find this name strange. This name is very strange, why is called Dommanip, that is called Dom Micro-operation.
In fact, there are a lot of important DOM operations in JQuery, and these operations are very often used in very high frequency, but these operations generally have a feature that requires fine tuning, such as converting a string to a elem element to determine if it is a script.
So a u
I. Document Object modelDOM Document Object model, which provides an excuse to access and dynamically modify documents, with the specification of DOM specifications, supported by mainstream browsers. The DOM consists of 3 parts, namely the Coredom, the XML DOM, and the HTML DOM.1. Core
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.