There's an Easter egg on Facebook:
Login facebook.com, click anywhere on your homepage, keyboard input up, up, down, down, left, right, left, right, B, A, enter, click on the page or scroll through the scroll bar, you will find special changes
1. Redefining the Window.onbeforeunload () event with JavaScript
You can define a function in JavaScript.
function Window.onbeforeunload () {Alert ("Close Window")}
The alert () event will be executed before closing the window, and you can also
Within the JavaScript method, there is an array of variables called arguments, which is read-only and all the actual argument variables passed in are
In the inside, through which we can check the incoming parameters for type checking to achieve the
This example describes the definition and usage of JavaScript insertafter (). Share to everyone for your reference, specific as follows:
HTML section:
bbbbbbbbb
dddddd
JavaScript section:
Window.onload=function () {
var a
In the afternoon to visit the user site, the feeling that the problem is really strange, and finally found that the computer is win 2000 of the operating system, feel the crux of the problem may be here, the internet Google, found that the original
Class structureFirst, let's build a shelf and list all the variables that need to be used. We need an array to hold the list of callback functions, a flag bit to indicate whether the asynchronous operation is complete, or to learn IAsyncResult, plus
The form's client JavaScript validation has a variety of ways to write, log in as a onsubmit event for the form, or submit a function by pressing the button. For small forms (forms with only one or two form fields), there is no need to specifically
The learning of classes in JavaScript, inheriting from basic classes.
You can also implement this:
Java code
Copy Code code as follows:
function Newclass () {
This.firstname= "Frank";
This.touc=string.touppercase;
This.tostring=
Original address:http://www.davidflanagan.com/2009/08/string-multipli.htmlOriginal Author: David FlanaganIn Ruby, the "*" operator uses a string as the left argument and a number as the right argument to duplicate the string. For example, the value
String
A string is one or more characters that are arranged together in single or double quotes.
' ABC '"ABC"
Length Property
The string in JS is similar to an array, and is made up of a single character, so you can use the Length property to
JavaScript simple implementation of adding more than one class to an element
div2{font-size:16px;
Color:orange;
}. div3{font-size:20px;
Color:blue; } Test
Above the JavaScript to add more than one class
javascript operation table features hello cell 1,1& lt;/td> cell 2,1 cell 1,2 cell 2,2
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
You can see the effect directly by clicking on
First, find the elements:
Docunment.getelementbyid ("id"); Search by ID, find one at most;var a =docunment.getelementbyid ("id"); The found element is placed in the variable;Docunment.getelementsbyname ("name"); Find the array by
1, what is the event delegate: colloquially speaking, the event is onclick,onmouseover,onmouseout, and so is the event, commissioned, is to let others do, this event was added to some elements, but you add to others to do, Complete this event.
That
Simple instance of JavaScript subtraction
accdiv: accMul: "accadd: accsubtr:
Above this JavaScript subtraction simple example is a small series to share all the content, hope to give you a reference, but also hope that
JS did not get the class method, found some packaging good methods, here to tidy up
(1) Encapsulation first
Encapsulates
the GetClass function getclass (tagname,classname)//obtain a label named TagName, the element
{
The following tutorial summarizes the knowledge of JavaScript in Web site positioning.
One, the absolute size and relative size of the Web page
First, there are two basic concepts to be clarified.
The whole area of a Web page is its absolute size.
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.