1. typeof operator. For function, String, number, undefined, and other types of objects, it is fully qualified, but for Array
CopyCode The Code is as follows: var arr = new array ("1", "2", "3", "4", "5 ");
Alert (typeof (ARR ));
You will
Example
This page is an example. Click a paragraph, edit it, and click ready. Your modifications will be displayed.
ProblemThe first problem I encountered was: I want to use a text box as the editing area. At first, I did not put the content
CopyCodeThe Code is as follows: function $ (ID) {return document. getelementbyid (ID );
The previous version of the browser is no problem, if you use an old browser, you can use the following functionCopy codeThe Code is as follows: function $
Five quick tips:
Only use the submit event on the element If you want to bind an event to form for processingProgramInstead of binding a click event to the submit button.March: This method is good, but when the company uses Web flow for
CopyCode The Code is as follows: var foreach = (function (){
// Array and pseudo array Traversal
VaR _ array_foreach = function (array, block, context ){
If (array = NULL) return;
// Special processing of string
If (typeof array = 'string '){
Array =
DOM elements have some standard events. Generally, you only need to use The onclick = function method. However, when you need to add multiple events to the DOM element and delete the event, or when Javascript is used to encapsulate controls and add
The lang. js Library provides the definition of packages and classes, class inheritance and mixing (mixin), function overloading, and other functions, which can basically meet the needs of most object-oriented design. It also supports the
Some browsers in the old version do not support javascript scripts. When a script node is used as a normal content output, sometimes to make the version compatible, comments will be written in the content of the script node. In this way, even though
First download node. js, decompress it to the E disk, change it to node, then Enter cmd in the menu, and use the cd command to switch to the decompressed directory of nodejs:
Example 1: hello world.
Create a hello. js file in the node directory,
I recently read several articles about javascript closures, including the recently popular Uncle Tom series and the articles in javascript advanced programming ,...... I can't understand it. Some of the Code is not read in university textbooks, and
UglifyJS
UglifyJS is a code compression tool built on the nodeJS server. Currently, jQuery uses this tool to compress and the compression effect is better.
GitHub home: http://github.com/mishoo/UglifyJS/
Online use:
Case 1: Press enter to implement Tab jump.
In response to the onKeyDown event in the text box, window. event. keyCode gets the keyCode clicked by the user.
(*) The keyCode and ASCII are not exactly the same. The ASCII value of the primary and
Each language has a special place. For JavaScript, using var can declare any type of variables. This script language looks very simple, however, to write elegant code, you need to constantly accumulate experience. This article lists seven details
Preface
Uncle Bob proposed and carried forward the Five Principles S.O.L. I. D to better implement object-oriented programming. The five principles are:
The Single Responsibility Principle (Single Responsibility SRP)The Open/Closed Principle (Open
4.1 string direct count
1. Direct string count
. It can be 0 or multiple.
. The string must be written in the same line. Too long + number
. Used to define that start and end double quotation marks and single quotation marks must match
2. escape
Document directory
3. Conclusion
1. How to connect strings?
First, let's review the two common methods of string connection:1.1 Use the String concatenation operatorCommon languages (such as Java, C #, and PHP) all have string Concatenation
Document directory
I. Preface
Ii. Getting Started
Iii. Improvement
Iv. Habits
4. Note
5. Reading
I. Preface
In the past, JavaScript was only used for some simple web page effects, such as form verification and floating advertisements. At
The limit is an integer.
Copy codeThe Code is as follows:
CheckNumber
Restricted to currencyCopy codeThe Code is as follows: // Trigger the eventOnblur = "checkMoney (this )"
Start with question:
Function Base () {} var base = new Base ()How many objects will the above two lines of code create )?
To answer this question, first clarify the concept of objects in Javascript.
Objects
In Javascript, almost everything is an
Document directory
Press any key ....
The KeyCode value collected on the internet is convenient for you to find:
Keycode 8 = BackSpaceKeycode 9 = TabKeycode 12 = ClearKeycode 13 = EnterKeycode 16 = Shift_LKeycode 17 = Control_LKeycode 18 =
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.