CopyCodeThe Code is as follows: // create a new user object and accept an object with many attributes as a parameter.
Function user (properties)
{
// Traverse all attributes of the object and ensure that its scope is correct
For (var I in
Table dragging (compatible with Firefox 3.5/IE6), fixed table width
NO. company name order customer Department salesman payment method 1 script house jb51.net advertising department Wang Tianyi cash
It returns an object, which contains four attributes: Left, right, top, and bottom, which correspond to the distance between the upper left corner and the lower right corner of the element and the upper left corner of the browser window (viewport.
For a specific demonstration, you can refer to add the Home Page function to favorites at the bottom of the home.
Set as homepage-add to favorites
[Ctrl + A select all Note: If you need to introduce external JS, You need to refresh it to
HTML file
Code As follows:
Copy code The Code is as follows:
JavaScript controls illegal character input
the following characters cannot be entered: (image! @ # $ % ^ & *)
no quotation marks are allowed here:
only numbers are
A few days ago, Mozilla submitted a draft to W3C to launch a javascript API that allows JavaScript scripts to directly operate on local files. Firefox's latest browser version already provides a lot of support for this API, however, for security
1) typeof Operator
Typeof is a unary operator. The returned result is a string indicating the number of operations. For example, "Number", "string", "Boolean", "object", "function", and "undefined" (used to determine whether a variable exists
Keydown: The Key is pressed when the control has focus.
Keypress: The Key is pressed when the control has focus.
Keyup: when the control has focus, the key is released.
1. keypress is mainly used to receive ANSI characters such as letters and
First:
Second:
Third:
Fourth:
Category 5:
===== Jump to other pages through the pop-up selection box in Javascript ====
===== Jump to other pages through a prompt box in Javascript ====
The default value of the parameter object is usually provided in the function. In this case, the extend is used to overwrite the input parameter to the default parameter, for example:
Code :
Copy code The Code is as follows: Giant. UI. imageshow =
Wbkt2t recently found a new term: closure. (If you fall behind, you must study it well.) Baidu and Google read the Principles and Examples and understand the powerful closure. Jquery has also carried forward the closure. Some personal development
To link to another page or refresh the current page, you can only use
Window. Name = "_ Self ";
Window. Open (window. Location. href, "_ Self") // note that there are two underscores
Replace location. href
To prevent a new window from popping up
I. Declaring a function)
Method 1: function functionname ([parameters]) {functionbody };
Example d1CopyCodeThe Code is as follows: function add (A, B){Return A + B;}Alert (add (1, 2); // produces 3
When we declare a function in this way, the
1. For reference type objects (I mean string, date, object, array, function, Boolean), The + operator operation process is as follows!
1. First, call the valueof method of this object to obtain the returned value.
2. Convert the value A to a number
The following two methods are commonly used in daily JS programming:
1. Mixed constructor and prototype (emphasis)
CopyCode The Code is as follows: function car (scolor, inumbers) {// The constructor is only used to define all non-function
CopyCode The Code is as follows: function checkmobile (){
VaR smobile = Document. mobileform. Mobile. Value
If (! (/^ 1 [3 | 4 | 5 | 8] [0-9] \ D {4, 8} $/. Test (smobile ))){
Alert ("the first seven digits of a complete 11-digit mobile phone number
1. Several Basic Concepts
Why?
When discussing inheritance, we have already listed some basic concepts that are closely related to encapsulation. Today we will discuss the basic concepts, it is mainly related to inheritance and polymorphism, but
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