DateAdd function:
Copy Code code as follows:
function DateAdd (interval,number,date) {
Switch (Interval.tolowercase ()) {
Case "Y": Return new Date (Date.setfullyear (Date.getfullyear () +number));
Case "M": Return new Date
The array of Javascript arrays, both an array and a dictionary (Dictionary). Let's take a look at the use of arrays.
Copy Code code as follows:
var a = new Array ();
A[0] = "Acer";
A[1] = "Dell";
for (var i = 0; i Alert (A[i]);
At present, the commonly used browser ie, Chrome, Firefox have the corresponding script debugging function. As our. NET camp, learn how to debug JS in IE is enough, in the grasp of IE debugging methods, Chrome and Firefox debugging methods have
The textarea element has been widely used in the Web-page IDE. Usually the site's own textarea editor does not meet our needs, as a developer we often need to do code online editing, highlighting code, etc., so, through other open source projects,
In the morning to see the "JavaScript Weekly Guide" "Phase III" of the article, which found an article (extending javascript–the right Way), feel good, translated to share with you, this article is not a word for translation, as far as possible to
The first two only difference is that the loop and the order of the judgments are different, do-while than while more than one cycle, I do not give an example.For loop I believe that we can not be ripe, we will see for-in this sentence.This is
The Replace function accepts two arguments, the first argument is a string or regular expression, and the first argument can also accept a string, or possibly a function.
First, we no longer need to say "I am a Boy" for the first parameter as a
In contrast to the in operator, for-in loops through the prototype chain when iterating over the object's properties, for-in does not read an enumerable property, such as the length property of the group. Summary when you detect whether an object
We know that the instanceof operator is used to check whether an object is an instance of a constructor. The following lists the various scenarios in which it returns true.
1. Object obj was created through new constructor, then obj Instanceof
Copy Code code as follows:
Say the red above the insert into the Web page you can achieve the right mouse click is not valid
Onselectstart= "return false" prohibits selection, ondragstart= "return false" to prohibit drag and drop,
The JavaScript described here refers to the hosting environment in the browser environment. The first is ECMAScript global object, and the second is global objects/functions under the Host Environment (host).
One, core JavaScript built-in object,
JS in different types of basic data can be converted between, this conversion is a rule can be found, not arbitrary random. There are 5 basic types of data in JS: String, number, Boolean, null, undefined, where the type commonly used for calculation
This article looks at how to judge an integer type by recording a number of ways in JavaScript that are judged to be numeric types.
JavaScript does not differentiate between integers and floating-point numbers, and all digits are represented in a 64
In the JavaScript world, there are a variety of ways to define a function, which is the embodiment of javascript flexibility, but it is the reason for beginners to be confused, especially for students without language basis. Is the so-called road to
This example describes a method that JavaScript converts a date string to a date date object. Share to everyone for your reference. Specifically as follows:
Here the implementation converts a date string such as "2014-4-28 12:31:45" to a Date
have been busy recently to complete the business needs, for a long time did not write a blog. Today for a little while, looking at some of the recent project's front-end code, see the Web color conversion function, suddenly think of when we do some
Unlike class-based programming languages, such as C + + and Java,javascript, inheritance is based on prototypes. At the same time, because JavaScript is a very flexible language, its implementation of inheritance is also very many ways.
The first
The example in this article describes the way JavaScript implements an analog clock. Share to everyone for your reference. The implementation method is as follows:
javascript analog clock current time:
The wants this article to
AOP is also called aspect-oriented programming, the "notice" is the specific aspect of the implementation, divided into before (forward notice), after (post notice), around (surround notice), with spring students must be very familiar with it, and
As we all know, the modern event binding (attachevent) in IE has many problems compared with the standard of the AddEventListener.
For example: memory leaks, recurring events and triggers are flashback execution, and so on.
The following is a
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