Private Method: A private method can be set to all the attributes inside the category, that is, private and public attributes. However, private methods cannot be called outside the class.
Private method Syntax:CopyCodeThe Code is as follows:
But sometimes, when an event is triggered, we need to do some operations first and then jump. At this time, we need to use JavaScript to implement this jump function.
The specific practices are as follows:
1. Jump to the new page and open it in the
I did not perform the test. For reference only
Code
Copy code The Code is as follows:
News test 1 News test 1
News test 2 News test 2
News Test 3 News Test 3
News test 4 News test 4
News Test 5 news Test 5
News Test 6
Policy & capture It is too easy to implement policy and capture. We only need to save the handler passed by capture, and then find the matched handler in policy.
CopyCode The Code is as follows: var filterhandlerbundles = [];
Dispatch. Capture =
Among many browser products, IE, Firefox, Opera, Safari ........ many brands have different standards. Therefore, you often need to perform different operations based on different browsers or even different versions of the same browser. Therefore,
The next step is BOM and HTML5, but since ECMAScript5 has many new changes compared with ECMAScript3, these changes are also very interesting, therefore, in this article, I will focus on the interesting changes I think (not all changes), but here I
First, create the HTML page sort.html and copy the following content.
Copy codeThe Code is as follows:
untitled document
ID | -
name | -
1
happy
3
open meal
5
open
ID | -
name | -
1
happy
This article is divided into two parts: basic patterns (upper part): full exposure, underline marking, and closure. Advanced Patterns (lower part ), there are other knowledge points about how to implement static methods and attributes and constants.
I believe most people may want to learn javascript here, but they still want to use it to combine the DOM elements on the page for some practical and useful interaction effects. So here I will only teach you the most practical and useful javascript
DateAdd function:
Copy codeCode: function DateAdd (interval, number, date ){
Switch (interval. toLowerCase ()){
Case "y": return new Date (date. setFullYear (date. getFullYear () + number ));
Case "m": return new Date (date. setMonth (date. getMonth
How to use JavaScript to convert an Array like [, 3, [, [], [[[8], 8? The legendary Array Flatten.
To solve this problem, we usually need Recursion to let the program loop by itself according to an algorithm. A book says, "recursion is a powerful
Preload and JavaScript Image () Objects
Many high-res images can make the Web site more clean and tidy. However, they also slow the Website access speed-the image is a file, the file uses the bandwidth, and the bandwidth is directly related to the
3.1 Basic Data Types
1. string type (string): it consists of unicode characters, numbers, and punctuation marks. In javascript, there is no char character type. A string must be used even if it only represents one character.
2. number: the integer
I encountered a small problem today. During DOM construction, IE cannot pass element. setAttribute ('name', _ variable); and element. name = _ variable; this form adds the name attribute to the element, whether it is IE6 or IE7. (IE8 is acceptable,
The function is as follows:
Copy codeThe Code is as follows: foreach = function (obj, insp ){
If (obj = null & obj. constructor! = Array ){
Return [];
}
// Obj is the array to be processed. obj = null indicates that the object does not exist. obj.
1. shift: Delete the first entry of the original array and return the value of the deleted element. If the array is empty, undefined is returned.
Var a = [1, 2, 3, 4, 5];
Var B = a. shift (); // a: [2, 3, 4, 5] B: 1
2. unshift: add the parameter
Test.htm
Copy codeThe Code is as follows:
array-remove-repeate
Watch. jsCopy codeCode: var Watch = {Result: [],Guid:-1,TotalTime: 0,Start: function (title ){This. result [++ this. guid] = [title | this. guid, new Date (). getTime
Instructions: Move Up, down, left, right, and left with spaces. Each time an attacker hits an enemy plane, an increase of 100 points means that the number of rounds of a player's plane increases by one to four points, if it is hit by an enemy plane
Let's look at a simple Javascript debugging package: jscript. debug. js contains two functions. The first is used to traverse each attribute of an object; the second is a general Debug function (in fact, 'object' is more 'accurate ), it is used to
The following describes how to handle and debug JS errors.
Method 1: Use the alert () and document. write () methods to monitor variable values.When the variable value is displayed in the pop-up dialog box, alert () stops running the code until the
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