Mouse events (top)
As the course goes on, the people who are able to follow down are fewer and less, do not know because there is not too much performance, just rote things, we are not interested ah. Actually on the page
A lot of special effects,
MouseDown Events and MouseUp events
As you know, the combination of the MouseDown event and the MouseUp event is the Click event, but if you press the mouse on the link and move outside the link to release the mouse, then only the moused
The own
1. Four browsers explain the ClientHeight, offsetheight and scrollheight of Document.body.These four types of browsers are IE (Internet Explorer), NS (Netscape), Opera, FF (FireFox).ClientHeightWe have no objections to clientheight, are considered
Chinese New Year has been relatively busy, let everyone down.
Learn the function today, although the statement has not finished.
Functions are a very important part of the JavaScript language, but they are also complex.
Here's a look at JavaScript
Let's take a look at the example below.
Copy Code code as follows:
jqueryDemo:quanjiaoNum
Chinese numerals convert to Arabic numerals:
It's a matter of judging the phone number! In addition, please note that I also
1, Focus : When an element has focus, then he can accept user input (not all elements can accept the focus)
How to set focus on an element:
1, click
2, Tab
3, JS
2. (Example: Input box hint text)
Onfocus: Trigger when element gets focus:
JavaScript is the most misunderstood programming language in the world. Some people think it does not have the ability to "information hiding" because JavaScript objects do not have private variables and methods. This is a misunderstanding.
This period of time has been to qzone research JS drag-and-drop problem. Today suddenly found that the Live.com module drag and drop incredibly can be stepped out of the browser. What is the way to let MouseMove and MouseUp events can be triggered
In the website development especially the news class website, often encounters the multiple column switching design, this kind of effect has many kinds of realization effect, now records a very simple writing:
Work dynamic Media link
Four basic data access locations in 1.JavaScript: literal, local variable, array element, object member.
In general: [literal, local variable] run speed >[Array, object member]
2. The Internal property contains a collection of objects in the scope
The target attribute is not allowed to be used in tags in HTML 4.0 strict and XHTML 1.0 strict, which is a frustrating thing for web designers. It is still allowed in the specification of the transition. But through certain methods, we can solve
Various methods of JS cyclic arrayEG1:
for (var i = 0; i
EG2:
Array.prototype.foo = "Foo!";
var array = [' A ', ' B ', ' C '];
for (var i in array) {
alert (array[i]);
}
for (var i, $GLOBAL _detail.album_photo_ids)
Here are two simple ways to do this:First Kind
var mergeto = [4,5,6],
mergefrom = [7,8,9];
MergeTo = Mergeto.concat (mergefrom);
MergeTo; is: [4, 5, 6, 7, 8, 9]
Or
var a = [1,2], B = [3,4], C = a.concat (b);
Look at the following code:
function Test (s) {
var reg =/./g;
Console.log (Reg.exec (s));
Console.log (Reg.lastindex);
var reg =/./g;
Console.log (Reg.exec (s));
Console.log (Reg.lastindex);
}
Test ("ABCD");
Test ("EFGH");
I think the output of the
Window Location
The Window.location object is used to get the address (URL) of the current page and to redirect the browser to a new page.
The Window.location object does not use the prefix of window when writing. Some examples:
Some
Add a new element at the beginning of the array-unshift ()Source code:
click the button to add elements to the array.
try it
Note: The Unshift () method does not work properly in Internet Explorer 8 And earlier, the values would be
Merging two arrays-concat ()Source code:
click the button to merge the array.
Point I
Test results:
Cecilie,lone,emil,tobias,linus
merging three arrays-concat ()Source code:
Test results:
All things in JavaScript are objects: strings, numbers, arrays, functions ...In addition, JavaScript allows you to customize objects.All things are objects .JavaScript provides several built-in objects, such as String, Date, Array, and so on.
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