There is an egg on Facebook:
Log on to Facebook.com and click anywhere on your homepage. Enter Up, up, down, down, left, right, left, right, B, A, and enter on the keyboard, click the page or scroll through the scroll bar, and you will find special
After selecting the base class, you can create its subclass. Whether to use the base class is entirely up to you. Sometimes, you may want to create a base class that cannot be used directly. It is only used to provide a common function for the
Recently I have read a lot of JavaScript Library source code, such as prototype and ext core. These libraries are widely applied to this concept. It was not until yesterday that the book "Return of the Javascript King" had a profound understanding
The format of the void operator is as follows:
1. javascript: void (expression)
2. javascript: void expression
Expression is a standard JavaScript expression to be calculated. Parentheses outside the expression are optional, but it is a good
Another powerful tool for IE is VML. Although it is not comparable to SVG, it is still very powerful. In terms of gradient implementation, its fill is much more powerful than IE's Gragient filter. However, VML appeared earlier and only a few color
Copy codeThe Code is as follows: var arr = new Array ();
Arr ['item1'] = 'the value of item 1 ';
Arr ['item2'] = 'the value of item 2 ';
Alert (arr ['item1']);
Alert (arr ['item2']);
However, the above functions do not meet our actual requirements.
Modified based on Jquery. The following are all scripts:
Copy codeThe Code is as follows: // search by word
Var GLS = {};
GLS. startObj = null;
GLS. isdb = false;
GLS. allow = true;
GLS. isallow = function (){
If (GLS. allow ){
GLS. allow =
The following tutorial summarizes the knowledge of Javascript in web page locating.
I. absolute size and relative size of webpages
First, we need to clarify two basic concepts.
The full area of a webpage is its absolute size. Generally, the absolute
Var x = "XX ";
Y = "xxx ";
And so on. This has a problem. For example, in a certain line of code, I want to use a declared variable x. As a result, the variable is written as y due to incorrect typing or spelling, the result is equivalent to
However, javascript does not have the concept of a class. The so-called class is also simulated. The class members and Private Members are simulated through the function plus the closure (for details about the closure, refer to crossing the boundary:
Recently, I encountered a js efficiency issue about adding elements to the page.
Suppose we have the following page:
Copy codeThe Code is as follows:
Now, we want to add objects to div1. We all know that the following code can be used to
For the following usage, you need to add the attribute onclick in JSP. For example, onclick = "javascript: allselect ()" // javascript can be omitted.
Or use document. getElementById ("allselectbox"). onclick = function ();
Select All:
Fuction
In fact, this Code has already been introduced in the previous article "using Javascript to achieve smooth jump between Anchor". However, this article is specially published on this site because this requirement is frequently used, easy to view.
This article describes a more common method to obtain the radio value.
Copy codeThe Code is as follows:
Like the checkbox, radio has the same name and multiple values. When obtaining the radio value, we cannot follow the common text box. value
We can see how straightforward the concept inherited here is. "Copy prototype of a class to another class". Good, Code is cheap, and check the Code:
Function class1 (){}Function class2 (){}Class2.prototype = class1.prototype;Class2.moreProperty1 = "
Arrayobj. sort (sortfunction );
Parameter: sortFunction
Optional. Is the name of the function used to determine the order of elements. If this parameter is omitted, the elements are listed in ascending order of ASCII characters.
The sort method
Constant:JavaScript constants, also known as literal constants, are information solidified in program code.
Variable:The main function of a variable is to access data and provide a container to access information.
Data TypeInteger: an integer
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.