Backbone.events Overview
The backbone.events object contains methods that help observer design patterns and a variable observer pattern that invokes pub/sub. These features allow different classes of objects (JavaScript objects) created by backbone
Backbone constructors
I say backbone is simple because backbone only four constructors can be typically instantiated (basically, they are first inherited or subcategory). These four constructors include:
Backbone.model = function (attributes,
Use Backbone.noconflict () to store and create a special (that is, custom namespace) references to backbone
When backbone is parsed by a browser, the first thing backbone does is to store a value that is referenced to the backbone contained in the
The last one was sent out after a lot of replies, in this first thank you for your enthusiastic supporters! Some recommend the third party framework, such as In.js, Requriejs, Sea.js, lab.js, etc. This broaden the horizon, previously only know
General Ideas
1, the establishment of a JS service, the service to achieve universal JS file loading, dependency, caching, updating and reuse.
2, each project if the use of general-purpose JS, can (BI) to (XU) use JS service to load.
3, JS
Originally wanted to coherent, the loading process has been written, but the card is, so had to be divided into two.
1, the page use to load boot.js.
2, then in boot.js dynamic loading bootload.js. With time as the identification of var datever =
1. All functions have a arguments object of their own, which includes the parameters to be invoked by the function. He is not an array, and if you use typeof arguments, it returns ' object '. Although we can call the arguments using the method that
Decorator Mode description Description: A class to dynamic to another class of functional objects before or after the modification, to add some additional functions; This is the decoration of the function of a class object, the decorated class with
JavaScript scopes are the accessible scope of variables and functions.
1. Variable Scope
In JavaScript, variable scopes are divided into global scope and local scope.
Global scope
You can define a variable with global scope Anywhere
1.
Recently, looking at some of the JavaScript principles of the article, happened to see the jquery author of a JavaScript timer on the principle of the analysis, and so scared to decide to translate the original text into Chinese, one is to share
3 problems related to the scope chain The scope chain is a very red concept in the JavaScript language, and many programmers who learn and use the JavaScript language know that the scope chain is key to understanding some of the most important
My last blog title is wrong, causing some misunderstanding. I think the purpose of blogging is not to recite textbooks, but to share research and development experience. My last title was changed to "one of the topics of JavaScript closures: its
Let's look at the closure's purpose. In fact, we can do a lot of things by using closures. For example, simulate object-oriented code style, more elegant, more concise expression of code, in some ways to improve the efficiency of code execution.
1
Closure is a relatively abstract concept, especially for the JS Novice. The explanation in the book is rather obscure, and it is the same for me.
But he is also JS ability to improve the one link can not be bypassed, almost every interview must ask
As Web sites become "Internet apps," JavaScript code embedded in Web pages is growing larger and more complex.
Web pages are more and more like desktop programs, need a team division of work, progress management, unit testing and so on ...
As you may know, the execution environment for a JavaScript language is "single-threaded" (single thread).
The so-called "single thread" means that only one task can be completed at a time. If you have more than one task, you must queue, the
Brief summary: Apply (): Call the function as a method of the specified object, passed to it is the specified argument array--function.apply (thisobj, args) or function.apply (thisobj, args) Bind (): main function: Bind a function to an object,
only objects in the 1.js, including objects, functions, constants, and so on.
Object without explanation. Functions also have properties, one of the common is prototype. Constants also have attributes:
(3). __proto__;//number {}
2. Prototype of
In JS, whether settimeout or setinterval, use the function name as the call handle can not take parameters, and in many cases must take parameters,This needs to be solved in a way.First, in the form of a string:--(defect) parameters can not be
1. Cursor Position gain:
$ (function () {
Document.forms[0].loginname.focus ();//loginname to get the cursor position name= "LoginName"
});
2. Cursor tab order, set Property TabIndex = "1", array representation order.
3. Back to Previous page
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