JavaScript is indispensable to WEB development and design, whether it is a simple Web page or a professional site, and whether you are a master or rookie, now the JavaScript library is more and more powerful, can do many complex work, but at the
First, the grammar:Loadscript (Url[,callback])OrLoadscript (Settings)Second, the settings supported parameters:URL: Script PathAsync: Asynchronous, default false (HTML5)CharSet: File EncodingCache: Caching, default to TrueSuccess: A function that
Someone asked a JS question:
Copy Code code as follows:
var i = 0.07;
var r = i*100;
Alert (R);
The result is 7.0000000000000001?
Check the data, in fact, we know that in Javsscript, variables are stored without
Take a look at a simple Javascript Debug package: Jscript.debug.js, which contains two functions, the first to traverse each property of the object, and the second is a generic debug function (actually say ' object ' comparison '). Precise ', hehe ',
First look at the effect:
Copy Code code as follows:
"
very simple to use;
Create a Calendar object first
Copy Code code as follows:
var calendar=new calendar ();
Just call the show () method
Copy Code code as follows:
Topic: Write a function that removes duplicate values from the given array.
Such as:
Incoming array A = [0, 8, 5, 4, M, 8, N, 4, ' A ', ' B ', ' a '];
Request return: [0,4,5,8,78,90,a,b]
For this
For example
Copy Code code as follows:
settimeout (function () {
Alert (' Hello! ');
}, 0);
SetInterval (callbackfunction, 100);
It is assumed that the greeting method in settimeout is executed immediately, because it
Increasingly feel that there is no teaching and educating atmosphere, in order to understand the closure of JS, I resorted to my English four level of sucking the strength to Google to search for the closure of the package explanation, when I saw
1 How do I connect a string? First, let's review two common methods of string concatenation:1.1 Using string concatenation operatorsCommonly used languages (such as Java, C #, PHP, etc.) have string concatenation operators, JavaScript is no
Github:https://github.com/hirokidaichi/namespace-js
Define namespace objects:
var Namespace
Now for a specific look at the definition of the Namespace object, it is a Namespacedefinition object. The object is a function object (the constructor of
Pre-loading and JavaScript Image () objects
Many high-res images can really make your Web site cleaner. But they also slow down access to the site-the image is a file, the file uses bandwidth, and the bandwidth is directly related to the wait time.
Copy Code code as follows:
function Fors () {
Obj_a = Obj_b;
Obj_b.attr = obj_a;
}
Copy Code code as follows:
function Fors () {
Obj_b = {};
Obj_b.attr = Obj_b;
}
Above are two very display
First of all, let a game be endowed with the gameplay must be combined with static and dynamic. Haha, people think I want to talk about the composition ... But actually I'm going to talk about JavaScript today) static stuff who wouldn't do it?
2.9 operator
2.9.1, unary operators
The unary operator has only one parameter, the object or value to manipulate.
1. Delete: Deletes a reference to a previously defined object property or method, but this operator cannot remove properties and
JS strings are string objects, you can use the length property of a string object to get their lengths, but whether it is Chinese, full-width symbols, and the English minimum length unit is 1, this is not the same as PHP's strlen ().
Copy
An event is an action performed by a user or browser itself. Click,mouseover, for example, are the names of events. The function of the corresponding event is called an event handler (or event listener). There are several ways to specify a handler
JavaScript lacks a block-level scope and does not have a private modifier, but it has a function scope. The benefit of the scope is that internal functions can access the parameters and variables of their external functions (except this and argument.
Properties of the Math object
E: Value E, bottom of the natural logarithm
The natural logarithm of the ln10:10
The natural logarithm of the Ln2:2
LOG2E: logarithm of 2 as the base E
LOG10E: logarithm of 10 as the base E
PI: Value Pie
The square
anonymous function, which is a function without a name. Such as:
Copy Code code as follows:
function () {
Alert (' a function ');
}
However, the above code will make an error. Firebug hint: Function statement requires a
This question was seen on the--stackoverflow of the famous question and answer website.
I have seen this problem of JavaScript before, but I didn't know it well, today I saw the answer on the StackOverflow, I feel good, and write it down to share
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