Compare with other compression tool compression rates:
1. JavaScript Compressor (http://dean.edwards.name/packer/)
With his own compression tool code as an example (v2.02) Packer compressed after a size of 7,428 bytes (remove annotation).
And our
Copy Code code as follows:
untitled document
qrasfdasfasfdasfsafasdfsafsafasdfasdfasd
Adding this string of code to the page also has a search function. Demo effect, please see this blog page with the mouse text
The JavaScript event processing mechanism was recently used to find some information.
When writing JavaScript programs, events are used
Copy Code code as follows:
Object.event = handler;
The way you initialize it. This
This article illustrates the way JavaScript determines whether Firebug is open. Share to everyone for your reference, specific as follows:
Often with Firefox + firebug debugging JavaScript friends know, one but open firebug, page JS operation will
JS itself is not an object-oriented language, in our actual development in fact, the object-oriented thinking is rarely used, it has always been thought that when it comes to reuse, it is encapsulated as an object, but as the current project is
The most lazy way to javasctipt compatibility is to use jquery's tool function. Try not to use functions such as ECMAScript, because many browsers report errors that cannot be found in the function. Here's a list of some JavaScript issues that
JavaScript as a flexible scripting language, its success is obvious to us. However, for JavaScript statements, you can not use the ";" At the end of this, I've been brooding about it! In addition to the confusion of the statement and its reliance on
JS Window
Window objects: http://www.w3school.com.cn/js/js_window.asp
Window objects are supported by all browsers. It represents the browser window.
All JavaScript global objects, functions, and variables automatically become members of the
Timer 1
Used to specify a program to be executed after a certain period of time.
SetTimeout ():
Format: [Timer object name =] SetTimeout ("", ms)
Function: Execute once.
Example:
Copy Code code as follows:
timer1.html
Many of the basics in JavaScript are basically the same as in Java, so there's no need to repeat them separately, including:
Various arithmetic operators, comparison operators, logical operators;
If Else statement, switch statement;
For loop,
There are two special properties inside the function: arguments and this. Arguments is a class array object that contains all the arguments passed in,But this object also has a property called Callee, which is a pointer to the function that owns the
The data contained in the object can be accessed in two ways
Both objects (property) and methods (method)
A property is a variable that is subordinate to a particular object, and the method is a function that a particular object can transport.
An
The format of the Stwith statement is generally as follows:
Copy Code code as follows:
switch (expression) {
Case Value:statement1
Break
Case Value2:statement2
Break
....
Case Value:statement
Break
Default:statement;
Keyword cannot be used as a variable name or function name
Copy Code code as follows:
Break
Case
Catch
Continue
Default
Delete
Todo
Else
Finally
For
function
If
In
instanceof
New
Return
Switch
This
All languages have the ability to type, JavaScript is no exception, it also provides developers with a large number of type conversion method, through the global function, can achieve more complex data types.
Copy Code code as follows:
Variables in JavaScript are declared by the VAR keyword (variable).
Copy Code code as follows:
var school = "Beijingyizhong"
You can also give variables multiple values by using the var keyword.
Copy Code code as
1. Case sensitive
In JavaScript, variables, functions, and operators are case-sensitive.
2. Weakly typed variables
Define variables with the "var" keyword only
Copy Code code as follows:
var age = 25;
var myscholl = "Sanxiao";
Overview: The composition of JavaScript, the role of each component,
One, the composition of JavaScript
JavascriptECMAScript (CORE) DOM (Document Object model) BOM (Browser object model)
1.1ECMAScript
ECMAScript is a ECMA-262 standardized
Event handling
One, event Source: Any HTML element (node), body, Div, button
II. Events: your operation
Mouse:ClickDblick Double clickOnContextMenu Text Menu
Copy Code code as follows:
//a program that disables the right key
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