1. array object An array is a common data structure. It is generally used to store a group of identical objects or data.
Main attributes:
Attribute
Description
Length
Number of elements in the current array
Built-in object:JavascriptThe defined object is called the built-in object! (For example, array, math, date)Host object:Objects running in a specific environment are host objects. For example, predefined objects provided by Web browsers are called
Parseint () is used to convert the string into an integer. Generally, as long as it is a string starting with a number, it can be used successfully, for example, the result of parseint ('123a ') is 123, and the result of parseint ('12 34') is 12.
The array of JavaScript has the following creation methods:
//Create ArrayVaRComputers =NewArray (); computers [0] = "Dell"; Computers [1] = "Acer";//Create a condensed ArrayVaRComputers =NewArray ("Dell", "Acer");//Create literal
Input Type = Button Value = Refresh Onclick = "Window. Location. Reload ()" > Input Type = Button Value = Forward Onclick = "Window. History. Go (1 )" > Input Type = Button Value = Backward Onclick = "Window. History. Go (-1
In the project, we need to create a checkbox keyword to prevent repeated features. The idea of using JS is as follows:
1. Get the text of all checkpoints and put them in the array.
2. Input a keyword loop array and use indexof to judge
Note:
Operate the parent window object in modaldialog
1, Cannot be usedWindow. Parent
Window. ParentIs Used inFrameIn the dialog box, it cannot be used to operate the parent window object.
2And correct practices
CallModaldialogBy passing
1. oncontextmenu = "window. event. returnvalue = false" will completely block the right mouse buttonBorder oncontextmenu = return (false)> NO Available for table
2. cancel selection to prevent Replication
3.Onpaste = "Return false" Do not
A small requirement is to display different content based on the input anchor (that is, the content after # in the URL). Remember what I wrote before, I don't know where I threw it, but I have to write another one. By the way, I have improved my
In JavaScript, try, catch, and finally can also be used for exception handling like in Java, C #, and other languages (supported by ie5.0 and later). The following is an example:
Script Language
=
"
Javascript
"
>
Function
Test
The RequestHelper used in JavaScript met a small requirement, that is, to display different content based on the input anchor (that is, the content following # in the url). Remember what I wrote before, I don't know where I threw it, but I have to
1. Close the window without prompting
2. Prevent iframeIf (top. location! = Self. location){Top. location. href = "http://www.34do.net ";}
3. determine whether an object exists or notDocument. all ("a") = null (nonexistent)
4. A subwindow is
With the rise of JavaScript frameworks such as jQuery, Mootools, and Prototype, Web developers have created amazing results based on these frameworks. All of the following 50 sites are based on JavaScript, but they have the same brilliant effect as
There are three methods. I only remember two. below is the test code. Some friends who do not know how to create JAVASCRIPT classes are used as references, and class inheritance are also issued to override the class method (but rewrite is not
// Use JavaScript to write the sample code for connecting the server to the databaseVar conn = new ActiveXObject ("ADODB. Connection ");Conn. Open ("Provider = SQLOLEDB.1; Data Source = localhost; User ID = sa;" +"Password = sa; Initial Catalog =
1. Non-digit Verification:
Var I = document. getElementById ('xxid'). value;If (! IsNaN (I )){Alert ("must be an integer! ");Return false;}
2. input continuous integer verification (using a regular expression ):
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