A. JavaScript introduction:Before learning JavaScript, there are some things you need to know first:HtmlXhtmlI don't think these need to go too deep, understand a probably on the line.JavaScript is:JavaScript is designed to add interactive behavior
Example
this pageis an example. Click on a paragraph, edit it, and then click Ready. Your changes will be presented.
Problem
The first problem I encountered was that I wanted to use a text box as the editing area. At first I didn't put the content
1, Using Javascript eval method.
2, using a Veriables Save Object "This" reference.
3, in InnerHTML, we can using a String to pass the prototype method.
e.g.
This is a very typical application of a background-position-x. The technical content is not high, but the idea is worth thinking about, proving that there are many things that can be adapted to DHTML. With the background map, if done more complex,
Use JS to do time correction, get the time of the machine, there is a bug.
Use JS can also get to the server time, the principle is to use AJAX request, the return of the header information on the server side of the time information, get to it.
The commonly used metacharacters are:
•. Find a single character, except for line breaks and line ends;
\w Matching letters, Chinese characters, numbers, underscores and other symbols;
\s matching whitespace (including spaces, tabs, etc.);
\d
1.
Using the properties of a variable
2.
Converts all letters in a string to uppercase letters.
3.
JS in a variable to add a hyperlink
4.
The IndexOf method, where the first occurrence of a specified character in a string is positioned. If
First of all, what's the regular expression? In fact, the introduction of concepts often does not help us understand what it is, so I would like to briefly describe the regular expression, in fact, is a string of records string rules, and so we read
Bricks and mortar, and then the wall, in the ECMAScript, the sentence is the walls we need to build. Statements and operators like, for people with a C background, it is natural, the following similar form to organize the relevant knowledge of the
1. Prototype chain
Rarely used alone
Copy Code code as follows:
View Code
Defines the superclass class, which has an attribute property and a method Getsupervalue
Function Superclass () {
This.property = true;
}
Usually only after work time can code, free to write a pure JavaScript version. The Calendar.js file is referenced, and then the ID of the input to be set to the Calendar control is set to calendar, and the input is changed to a calendaring control.
This article examples for you to share a JS form verification of the specific code for your reference, the specific content as follows
Online demo:http://www.hui12.com/nbin/csdn/jsinput/demo.html
Effect Chart:
/* Authentication type
First, the constructor
Number (value)
New Number (value)
Second, number attribute
1. Number.MAX_VALUE returns the maximum number that can be represented.
2, Number.min_value can represent the smallest number.
3, Number.NaN non-numeric value.
4
A function is a statement that can be run at any time, simply put, a function is a set of statements that completes a function, and it accepts 0 or more parameters.
the basic syntax for a function is as follows
Copy Code code as follows:
A. String
Copy Code code as follows:
var language = "JavaScript";
var language = ' JavaScript ';
Strings can be used in double quotes and single quotes, depending on your personal preference.
The string has a length
How do we iterate through the elements in the array? 20 years ago when JavaScript was first born, you could implement array traversal like this:1 var arr=["One", "one", "three"; 2 for (var i=0;i) {3 document.write (Arr[i]); 4 } Since ES5 is
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