The mountain cannot be boarded, not because of physical strength, but because of a grain of shoes. The same is true for learning. Therefore, it is necessary to learn the details of JavaScript that are common and different from other languages.
A previously unknown concept-closure emerged in JavaScript. What is a closure? On the surface, it is a closed package, which is related to the scope. So, let's talk about the scope before the closure.
GLOBAL SCOPE
Local Scope
Scope chain
Execution
Onunload and onbeforeunload are called during refresh or shutdown. You can use window in the & lt; script & gt; script. onunload to specify or specify Onunload in & lt; body & gt;. onbeforeunload is called during refresh or shutdown. You can use
In jquery, the attr () method is used to obtain and set element attributes. attr is the abbreviation of attribute. attr () and attr () are often used in jQueryDOM operations () there are 4 Expressions 1. attr (attribute name) // obtain the attribute
In the project, when the customer closes the pop-up window, if the red X or cancel button is clicked, the message "confirm to save the current operation" is displayed, otherwise, I won't be prompted to write this in the pop-up window.
The Code
Introduction to the String type of javascript learning notes. Here we will introduce common functions of js String processing. 1. Character Methods: charAt (), charCodeAt (), fromCharCode ()
The Code is as follows:
Var stringValue = "hello world "
Javascript learning notes some basic concepts of js. If you are studying javascript, refer to the 1. typeof OPERATOR: used to detect the Data Type of a given variable.
The Code is as follows:
Var message = "some string ";Alert (typeof message); //
Introduction to the Array type of javascript learning notes. For more information, see create an Array.
First:
The Code is as follows:
Var colors = new Array ();Var colors = new Array (20); // create an Array containing 20 itemsVar colors = new
Sometimes you need to allow users to upload multiple files on the page. The number of files is determined by the user. You can delete the files if the number is too large. jQuery can easily implement this function.
The Code is as follows:
JQuery flop or shutter effect (Automatic Content Switching in three seconds), so that the list content is no longer boring core code:
The Code is as follows:
$ (Function (){Var timer = true; // execute the upward or downward SwitchVar liindex =
On the Internet, you will often see some very long web pages that will delay loading images. I think this is a pay-as-you-go approach. The web pages only load the images after those who want to continue browsing the Web pages, while minimizing
Uploadify is a simple and practical flash Upload Component with good compatibility. Now html5 version official address: http://www.uploadify.com/
Offered by: http://www.jb51.net/jiaoben/21484.html
Official English documents:
The non-blocking method in NodeJs is introduced. If you need it, refer to the following. First, we use NodeJs to build a basic server.
Index. js
The Code is as follows:
Var requestHandler = require ("./requestHandler ");Var server = require
I was surprised to see kuibono's article in the garden saying that JQuery will not automatically recycle the xmlHttpRequest object and will create a new xmlHttpRequest object after each Ajax request, I simply wrote a program for verification. As
Use Javascript to export data to the function code of the external Excel document. For more information, see
The Code is as follows:
Function AutomateExcel (){Try {// Start Excel and get Application object.Var oXL;Try{OXL = new ActiveXObject
The drop-down prompt layer of the jQuery-based input box allows you to easily enter the prompt information in your mailbox. For more information, see
Code Section
The Code is as follows:
// JavaScript Document(Function ($ ){$. Fn. extend
. Hover (func1, func2) is equivalent to: mouseenter (), mouseleave () Because hover is not a standard event, you cannot directly use live for processing, so use the following method instead, the effect is the same.
The Code is as follows:
$
The company's projects have this requirement. After learning mootools in this period, they wrote the functions as the mootools plug-in. I personally feel that mootools has a better plug-in code than jquery in this respect.
The Code is as follows:
Chosen is a JavaScript plug-in that can make the ugly and long select box look better and more convenient. Currently, it supports jQuery and Prototype JavaScript Engines. Chosen plugin http://www.jb51.net/jiaoben/38027.html
The Code is as follows:
The main principle is the principle of fast sorting: Find the benchmark, create two Arrays for storage, and recursive core code:
The Code is as follows:
Function quickSort (arr ){// If the array has only one number, it will be returned
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