Today, I am working on a blog forwarding function. Just like the function of Sina's meager broadcasting, there is a textarea, which is the box where we send a meager message, when someone else clicks this forwarding button, his meager content will
When variable A is assigned to variable B, the value in the stack is copied to the space allocated for the new variable.
How to Understand?CopyCodeCode: var x = y = 1;Y = 2;Alert (X );
What is the value of X?Copy codeThe Code is as follows:
In IE, we can use sourceindex. In standard browsers, we can use comparedocumentposition. But what about the old standard browsers? What about XML? Therefore, we need to determine the relationship between a node and another node based on its
The specific JavaScript code is as follows:
Copy codeThe Code is as follows: var getSiblingNode = function (className, elAr, el, not ){
ClassName = "" + className + "";
Var Arr = [];
For (var I = 0, l = elAr. length; I If (elAr [I]! = El & (elAr [I].
Copy codeCode: var Fundamental = {count: 1 };
Function Test (){}
Test. prototype = Fundamental;
Test. prototype. increase = function () {this. count ++ ;};
Var test = new Test ();
Console. log (test. count );
Var test2 = new Test ();
Console. log
Table objects of JS objects (excerpt)
Table object setTable object: The table in the HTML document. For each mark in the document, the browser creates a Table object.
Set
Description
Cells []
Returns an array
1. document. form. item Problems(1) existing problems:
Many statements such as document. formName. item ("itemName") exist in the existing code and cannot be run in Firefox.
(2) solution:
Use document. formName. elements ["elementName"]
(3)
The W3C standard recommended syntax is to get an element in the DOM tree through the document object. Common methods include getElementById (), getElementsByName (), getElementsByTagName (), they return a single node or node set through the id and
1. decodeURI () parameter: string
Function Description: decode the URI encoded by the encodeURI () function.
Instance:
Decodes a http://www.jb51.net/My%20first/ to a http://www.jb51.net/My first/
2. decodeURIComponent () parameter: string
Function
1. Lightview
Lightview is developed based on Prototype and Script. aculo. us. It is used to create a mode dialog box that can overwrite the entire page. The displayed content can be not only images, text, webpages, content called through Ajax, but
I. SummaryThis series of articles aims to abstract common, cross-Browser Scripting methods.
This article explains the javascript Functions on the floating layer and the principles and precautions of the functions.
II. Implementation results Using
JQ ui and YUI widget. It is also encapsulated in a solid, compatible, and universal manner. So while the code is complete, the amount of code is naturally not small. Even if it is built on the base library, the code is hundreds of lines.
Such a
Copy codeThe Code is as follows: var JsObject ={}| | new Object ();
JsObject. extend = function (subClass, superClass ){
// First determine whether the subClass has been defined. If not defined, the class is redefined.
If (typeof subClass =
Copy codeThe Code is as follows: // inspired
// Http://www.cnblogs.com/jkisjk/archive/2011/01/28/array_quickly_sortby.html
Var hasDuplicate = false;
Var sortBy = function (nodes ){
Var result = [], array = [], n = nodes. length, I = n, node;
While
HTML Title:
Copy codeThe Code is as follows: hello, Mr-S.R Lee
JavaScript:Copy codeThe Code is as follows:
Complete DEMO code:[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
First:
Copy codeThe Code is as follows: var lennon = Array ();
Lennon ["name"] = "windy ";
Lennon ["year"] = "1989 ";
Lennon ["living"] = true;
Alert (lennon. length );
Result: lennon. length is 0.Cause:Add an array element without changing
This section uses the onMousedown event and event. button attributes. The main functions and usage are as follows.
• The setTimeout method executes an expression only once after a specified time delay after loading.
• The charAt method returns a
It is a dynamic array because data is dynamically added;
Copy codeThe Code is as follows: var myarr = new Array ();
Myarr [0] = 1;
Myarr [1] = 2;
Myarr [2] = 3;
Myarr [3] = 23;
Myarr [4] = 11;
Use for traversal;It is a dictionary object
What is the process of stack zone and pre-execution for resources not released? The following is a common example:
For example, we now have a ul, and there are a lot of li below. We need to traverse them and bind them with click events, and then
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