javascript document body contenteditable true document designmode on void 0
javascript document body contenteditable true document designmode on void 0
Discover javascript document body contenteditable true document designmode on void 0, include the articles, news, trends, analysis and practical advice about javascript document body contenteditable true document designmode on void 0 on alibabacloud.com
Document.filemodifieddate//File modification date, Read-only property document.filesize//File size, read-only properties Document.cookie//settings and readout Cookiedocument.charset//Set character set Simplified Chinese: gb2312———————————————————————Common Object Methodsdocument.write ()//dynamically write content to page document.createelement (tag)//Create an HTML tag object document.getElementById (ID)// Gets the object with the specified ID value document.getelementsbyname (name)//Gets the
frame, the binding is only executed on the Load event, so it is natural that the original onload binding method is executed. And this page is just in the test environment, there is an inaccessible resource, the delay of more than 10 seconds is its magnified time difference.Window.onload Page Loading Tips We look closely at the following two code, code one of the window.onload = DoIt () function is followed by (), and code two of the window.onload = doIt function name is not followed by parenthe
Opening a Word document in C # is not too difficult, and there are many methods.Method for opening a Word document in I. C # Copy codeThe Code is as follows:// Add a reference to Microsoft Word 11.0 object library to the project referencePrivate void button#click (object sender, System. EventArgs e){// Call the open file dialog box to obtain the WORD file, RTF fi
Object Properties
Document.title//Set document title equivalent to HTML title tagDocument.bgcolor//Set page background colorDocument.fgcolor//Set foreground colors (text color)Document.linkcolor//not-clicked link colorDocument.alinkcolor//Activate the color of the link (focus on this link)Document.vlinkcolor//clicked on link colorDocument.url//Set URL property to open another page in the same windowDocument.filecreateddate//File creation date, read-o
be referenced as attributes of the body object.
10. title object: indicatesTag pair, used to set and reference content on the tab bar of the webpage
Their reference examples:Document. all. imag1.srcDocument. images. imag1.srcDocument. images. item ("imag1"). srcDocument. images. item (0). src
You can use the same method to access other elements. Of course, you must specify the name or ID attribute for
Add the following code to the front of the JavaScript
Copy Code code as follows:
/* @cc_on _d=document;eval (' var document=_d ') @*/
To join such a line of code IE's document access speed can be increased by at least 5 times times more
Here is the test comparison code before and after joining
, window. location. protocol
URL protocol section
Returned value in this example: http:
3, window. location. host
Host part of the URL
Return Value in this example: www.x2y2.com
4, window. location. port
URL Port
If the default port 80 is used (update: Even if port 80 is added), the return value is not the default port 80, but an empty character.
Returned value in this example :""
5, window. location. pathname
URL path (that is, the file address)
Returned value in this example:/fisker/post/0703/
, according to the figure to obtain the total number of elements
Copy Code code as follows:
var Tools = {};
Tools.getelementcount = function (e) {
var count = 0;
Elementtotal (e);
Document.table.txt.value = "element:" + count;
function Elementtotal (e)
{
if (E.nodetype = = 1) count++;
var children = E.childnodes;
for (var i = 0;i{
Elementtotal (Children[i]);
}
}
};
This article mainly introduces rewriting document. write to load javascript ads without blocking. If you need it, you can refer to loading javascript without blocking. This has a great effect on page performance optimization, this effectively reduces the page loading blocking caused by js. Especially for some advertisement js files, because the advertisement cont
The document Object and window object of JavaScript are described in detail. Learn more about the common usage of JavaScript.
[Document Object]This object is an attribute of the window and frames objects. It is a document displayed in a window or frame.
Attribute
AlinkColo
. body. appendChild (oTag)-----------------------Body-subject sub-ObjectDocument. body // specify the beginning and end of the document body, which is equivalent to body>/body>
Javascript to retrieve all images of the documentFunction updateUI (){Var imgs = document. getElementsByTagName ("img ");For (var I = 0, len = imgs. length; I Imgs [I]. title = document. title + "image" + I;}Var msg = document. getElementById ("msg ");Msg. innerHTML = "Updat
){Var count = 0;ElementTotal (e );Document.table.txt. value = "element:" + count;Function elementTotal (e){If (e. nodeType = 1) count ++;Var children = e. childNodes;For (var I = 0; I {ElementTotal (children [I]);}}};
Note: You can add 5. uppercase textCopy codeThe Code is as follows: Tools. ModifyElement = function modify (e ){If (e. nodeType = 3)E. data = e. data. toUpperCase ();Else{For (var I = e. firs
Document Object Content CollectionDocument text Object-JavaScript scripting language description———————————————————————Note: The names of the elements on the page, the Name property, and the JavaScript reference must consistently include caseOtherwise you will be prompted with an error message "The referenced element is empty or is not an object \\\\\"———————————
We already know that there is a cookie attribute in the document Object. But what is Cookie? Some Web sites store some information with small text files on your hard disk. These files are called cookies. Mdash; MSIE help. In general, Coo... SyntaxHighlighter. all
We already know that there is a cookie attribute in the document Object. But what is Cookie? "Some websites store some information on your hard d
document can easily lead to confusion, because it cannot tell which text node represents which string. In addition, it is common to see adjacent sibling nodes in the DOM document, which makes it necessary to have a method to merge adjacent text nodes. This method is the normalize () method defined by the Node type.
If the normalize () method is called on an element that contains two or more text nodes, all
# After learning the object-oriented programming language such as Python, you can learn JavaScript in its way of thinking . # DOM Document Object model is equivalent to a package, or module, defines a number of classes, to do the operation of the Web page;#Document Type#an instance of the Document object when HTM
!"); } /*Execute correctly*/Script>Body>HTML>The second is to put the event bindings in the Window.onload:DOCTYPE HTML>MetaCharSet= "Utf-8">HTML>Head> title>1-3title> Scripttype= "Text/javascript">window.onload= function() {document.getElementById ("Panel"). onclick= function() {alert ("The element has been loaded!"); } } Script>Head>Body>DivID
(otherNode) 16);} else {var node = otherNode. parentNode; do {if (node = refNode) {return true;} else {node = node. parentNode ;}} while (node! = Null); return false ;}}
This general contains () function uses three methods to determine whether a node is a descendant node of another node. The first parameter of the function is the reference node, and the second parameter is the node to be checked.
In the function
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.