The following excerpt the source code, in-depth analysis of his design to achieve the idea:
Copy Code code as follows:
function Format (string) {
var args = arguments;
var pattern = new RegExp ("% ([1-" + Arguments.length + "])",
Load the page before loading the principle of advertising:The order of the page is in order to load the page from top to bottom to complete, so want to make the advertisement does not affect the page to open the speed, must wait for the page all
Originally used in the Try-catch way, in the catch statement, we will receive an Error object (we can also throw a custom exception object). The Error object in Firefox has the following properties:
message--error message
filename--represents the
The order may be messy, write more collated, some terminology may be used or inappropriate, welcome to criticize. The following examples of the use of the program are verified by my actual, compatible with the major browsers. OK, step to the point.
But the author Nicholas C. Zakas did not delve into possible problems and solutions when creating objects in a "dynamic prototyping" way. In succession, the bottleneck of "dynamic prototype" is explained. That is, when inheriting a subclass, it
During the groping process, see such characters as "\155", used in place of the character "M". Why? .... Completely do not know the reason, the whole person suddenly panic! Don't say your 4 years of experience! "\155" and "M" is congruent, until now,
Give an example:
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Just try to know that this code means to declare a function and execute it immediately, because the variable
Make sure your code is as concise as possible
Don't rely on javascript for everything. Do not write repetitive scripts. To make JavaScript as a candy tool, it only plays a role in beautification. Don't add a lot of JavaScript code to your site. Use
Jqury Framework is definitely the first choice for the development of the page, the code is short and strong, the disadvantage is the lack of object-oriented features, fortunately there are many plug-ins! As for ext is a giant, highly
Introduction:
Today I see someone else's topic:
Copy Code code as follows:
function fn (x) {
x = 10;
Arguments[0] = 20;
Console.log (X,arguments[0])
}
FN ()
Feel oneself to this also is a smattering of, oneself also
First create an HTML page for sort.html and copy the following content into it
Copy Code code as follows:
Untitled Document
ID|-
name|-
1
Happy
3
Dinner
5
Open
ID|-
Please see source code:
Copy Code code as follows:
function Clone (o) {
var F = function () {};
F.prototype = O;
return new F ();
}
First Look at Ext (4.1 of 1896 lines start) of the prototype inheritance.
Copy
The first time I encountered this problem was in the era of DHTML. We do all kinds of things with browsers, plus a variety of animated menus, 3D tags (we've learned to stop using them now), but we've always been told that JavaScript is not available.
Summed up a number of methods to compress it into a function object, only dozens of lines of code, the use of the method is simple and straightforward
Save As Ojburl.js
Copy Code code as follows:
/*
Description: This code can be freely
One, what is Qunit
Qunit (http://qunitjs.com/) is a very powerful JavaScript unit test framework that can help you debug your code. It was written by a member of the jquery team and is the official jquery test suite. But Qunit is generally enough
JavaScript provides the date format is too simple, the general application needs to implement the format of the method. Here is a format I came up with, should be able to meet the common needs. You can use any separator in a date template, and you
Scope is always the most important in any programming language, because it controls the visibility and lifecycle of variables and parameters. Here, we first understand two concepts: block-level scope and function scope.
What is a block-level scope?
In the real sense, JavaScript is not an object-oriented language, does not provide a traditional way of inheritance, but it provides a way of prototype inheritance, using the prototype properties provided by itself to achieve inheritance.
Prototype
Everyone hates advertising. Watching TV, watching movies, watching Youku, looking at the Web page, the advertisement is also disgusted with the flying. Advertising is an unattractive thing. However, for a small webmaster/blogger, advertising is
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