Objective
JavaScript is an object-based dynamic language, that is, everything is an object, and a typical example is that a function is also considered an ordinary object. Javascript can achieve object-oriented programming through certain design
Push methodAdds a new element to an array and returns the new length value of the array.
Arrayobj.push ([Item1 [item2 [...] [Itemn]]])
Parameters
Arrayobj required option. An Array object.
Item, Item2,... itemn option. The new element of the
Preface: Today read the canvas canvas of JS book, Good Happy ~ is the beloved canvas~ oh yes ~
Before I saw someone suggested that I paint blue fat, oh, how do I put the favorite childhood blue fat forget, in order to express my apology to the blue
1. Background
JavaScript in the callback function, I believe that everyone is not unfamiliar, the most obvious example is to do the AJAX request, provided by the callback function,
In fact, the event-handling method (Onclick,ondblclick, etc.) of the
In this article, the authors introduce 7 different JavaScript syntax in IE and Firefox.
1. CSS "Float" value
The most basic syntax for accessing a given CSS value is:
Object.style.property
, use the hump to replace a value with a connector, for
Convert to Boolean type
All of the values in JavaScript can be implicitly converted to Boolean types, such as:
Copy Code code as follows:
0 = false; True 1 = = true; True ' = = false//true NULL = = False//True
However, these values
The so-called scope, can be simply understood as a can read, write scope (region), some of the JS experience may say: "JS does not block-level scope", JS in addition to global role outside, only functions can create scope. One benefit of scopes is
This article describes the 14 rules you should follow to write JavaScript code. Share to everyone for your reference, specific as follows:
1. Always use ' var '
In JavaScript, a variable is not a global scope is a function range, the use of "var"
CSS multi-browser compatibility issues and solutions
First, Document.formName.item ("itemname") problem
Problem description: Under IE, you can use Document.formName.item ("ItemName") or document.formName.elements ["ElementName"];firefox, You can
There are many ways to learn jquery, and today we start with the ready function of jquery. The code in this example comes from the JQuery script library.
If you have used jQuery, you must have used the ready function, which registers functions that
Although the syntax of JavaScript is very simple, it is still difficult to write a program because of its operating environment: web-based browsers.
JSLint
JSLint is a web-based tool for validating JavaScript error codes. It has the features and
Nested functions (Scope chain)
When you are nesting a function, be aware that the actual scope chain is changing, which may not seem intuitive. You can put the following code into the Firebug monitoring value changes.
Copy Code code as
one, JavaScript data
JavaScript data is divided into two types: simple data and complex data. Simple data contains five of number,string,boolean,undefined and null; complex data is only one object. "Here friendship acknowledgement Li Shi teacher,>
An introduction to functional programming When it comes to functional programming, people's first impressions tend to be their academics, obscure, probably only in the way that the heads are distributed, slovenly, and even neurotic college
I have in the development work and not according to the norms of the development of colleagues to cooperate with him can not use the "happy" to describe the. Now I write the purpose of this article in addition to share a little experience with you,
Here is a summary of JS error handling and Debugging methods
Method 1: Monitor variable values with the alert () and document.write () methods.Alert () stops the code from running while the dialog box displays the variable value until the user
Copy Code code as follows:
var ClassA = function () {
THIS.PROP1 = 1;
}
CLASSA.PROTOTYPE.FUNC1 = function () {
var that = this,
VAR1 = 2;
function A () {
return function () {
alert (VAR1);
alert (THIS.PROP1);
}.apply
For the array object My summary thought is: 5 method, 3 strokes, 12 style
1. Statement 5 method: Only for one-dimensional arrays, and of course two-dimensional three-dimensional, here is no explanation
Copy Code code as follows:
var
var ie =!-[1,];
This code was previously known as the world's shortest ie decision code before IE9. The code is short but contains a lot of JavaScript basics in it. In This example , the code executes with the array's toString () method called First
Generally speaking, the process of the interview or harvest a lot, is mainly to understand their differences in the end how much, the extent of knowledge in the end how narrow, the appropriate blow to self-confidence or necessary. Here's 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.