We usually verify the date in JavaScript, the basic idea is to determine whether the day is valid, and then judge whether the month has the day, such as some months without 31st, excepting Hile No 29, 30th, Leap year February without 30th and so on.
First Kind
document.body.oncopy = function () {
settimeout (
function ()
{ var text = clipboarddata.getdata ("text");
if (text) {
text = text + \ r \ n This article is from: (www.jb51.net) Detailed source reference:
Actually this is a cliché question. About this article is very many, in fact, I thought I had already understood it, but yesterday in the process of doing the project, or appeared a trace of doubt, think about before the JavaScript weekly in the
Recently a period of time to see a lot of JavaScript library source code, such as prototype, EXT core and so on. This concept is applied extensively in these libraries. It was not until yesterday that the book "The Return of the JavaScript king" was
Usually we get the event object generally written as follows:
Copy Code code as follows:
function GetEvent (event) {
Return Event | | Window.event//IE:window.event
}
If there are no arguments, it can be written (non ie:
First, simplify the codeWith a shorter wording, not only can you reduce the number of characters you enter, but you can also reduce the file size. Most of the code is simple to use, the efficiency of implementation has been slightly improved.
1.1
Raphael is a Javascript library that is used to draw vector graphics in a Web page. It uses SVG recommended standards and VML as the basis for creating graphics, you can easily create a variety of complex columns, pie charts, graphs, and other
1. Non-variability of strings
After the string is defined, it will occupy the memory space, the Penguin the Memory Space (stack) can not be assigned a value.
2. Short Circuit operation
The && two operator returns the original value (original data
Call Portal
A chained invocation has two entrances to the Async.go method and the Async.chain method, which are essentially consistent, except that the Async.chain method does not provide the initial parameters when invoked, and the Async.go method
The code looks like this:
var arr = [5,32,28,66,2,15,3];
Arr.sort (function (A1,A2) {return
a1-a2;//a2-a1 input Reverse
});
Console.log (arr);
Console.log (Arr.reverse ()); Reverse reverse the order of elements in an array
var arr2
Delivery Callback
One of the first things we have to consider is how to pass the callback entry. In the most traditional xhr invocation, the callback function is passed as the last argument to the asynchronous function:
Copy Code code as
problem
In AJAX applications, calling XMLHttpRequest is a common case. In particular, client-centric AJAX applications, various operations that need to obtain data from the server are completed by XHR asynchronous calls. However, in single-threaded
constants: JavaScript constants, also called Literal constants, are the information that is solidified in program code.
variables: The main function of a variable is to access data, providing a container for accessing information.
This article focuses on the first reason. Finally, a development pattern is given to replace the traditional loop structure, which can completely avoid the situation that the script is out of control.
Original title:Speed up Your JavaScript, part 1
Splice in JavaScript is primarily used to manipulate arrays in JS, including deletions, additions, replacements, and so on.
Note: This method will change the original array!.
1. Delete-To delete the element, two parameters, the first argument (to
1. Writing JS functions
2. HTML element to show/hide plus id attribute
control the show/hide of this TR
3, add buttons, links, etc trigger JS function
Show/Hide
JavaScript shows hidden layers Advertising
Two: JavaScript controls
Copy Code code as follows:
Here are some of my share, I love programming, hope to be able to pay more programming enthusiasts, if you are also one of them, then please add friends, we pay attention to, the following article is that they feel
Front.
As a common application of the date object in JavaScript, the simple calendar is widely used, this article will explain the realization of the simple calendar in detail.
Effect Demo
HTML descriptionUse the two input of type=number as 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