A registration box for form validation processing
As shown in figure
A simple validation hint function
Code thinking is also relatively simple
The input box is detected and processed when it loses focus
form has onsubmit = "return check ()"
1, the use of JS file management code
All the code as far as possible in the JS file, and then use the script in the HTML file introduction, the introduction of the attention placed behind the body tag, and do not use type or language.
2. Writing
This example analyzes the usage of eval functions in JavaScript. Share to everyone for your reference. The specific analysis is as follows:
Eval () has only one parameter, and if the incoming argument is not a string, it returns this argument
The example in this article analyzes the use of sort () in JavaScript. Share to everyone for your reference. The specific analysis is as follows:
Syntax for functions:
Arrayobject.sort (SortBy)
You are not the right way but your love
The example in this article describes the method of JavaScript conversion binary encoding to ASCII code. Share to everyone for your reference. as follows:
enter some binary to decode:
The wants this article to help you with
Having studied a DSL for a while, and discovered so many interesting things, JavaScript uses most of the things that are chained to the call (method chaining). The interesting thing is Martin Flower points out:
Copy Code code as follows:
About the file API here is not explained in detail, small partners to their own Niang it, we will use the file handle to read the file content, this is achieved through the FileReader, through the FileReader interface, we can asynchronously load the
What is callback
Copy Code code as follows:
A callback function is a function called by a function pointer. If you pass the pointer (address) of a function to another function as an argument, when the pointer is used to call the
This example describes the way JavaScript uses pointer manipulation to implement the Josephson problem. Share to everyone for your reference. The specific analysis is as follows:
Before implementation of course to write some of the JS array of the
The following content mainly through the JS code to introduce you, the code is relatively simple, including comments, there are good suggestions welcome.
The following figure, when a query condition contains a date, such as "2012-3-4", verifies
This chapter describes how to achieve a number of two-bit decimal effect, if the number of the original number of decimal places less than two, then the missing automatically fill 0, this is also for the unified effect, first look at code examples:
Browser sniffing is now deprecated, but it is needed on some occasions. For example, some statistical scripts. In the standard browser, provided the document.implementation.hasfeature, unfortunately there are bugs, inaccurate, at present, the
Let's take a look at an example
Note that:
AddEventListener and attachevent difference in the first argument the former is click the latter is the onclick
AddEventListener is running in the element scope where the element is
This code is placed inside the code of the PC template.
This code is in the mobile website template
Ps:js to judge the mobile end and PC-side jump code
var browser_class = navigator.useragent;
var
The object inheritance mechanism of the physiognomyThis example uses UML to explain the inheritance mechanism well.The simplest way to illustrate inheritance is to use a classic example of a geometric shape. In fact, there are only two types of
The development of DOM is related to the trend of web standardization. Only based on the correct semantic logic, DOM can play its function correctly. Today, the right semantic structure, performance and content separation requirements, have become
In JavaScript, the logical NOT operator is the same as the logical not operator in C and Java, and is represented by an exclamation point (!). Unlike a logical OR and a logical AND operator, the logical NOT operator returns a Boolean value.
the
Programming paradigm
The programming paradigm is a framework that consists of thinking about problems and realizing the vision of a problem. Many modern languages are clustering paradigms (or multiple paradigms): They support many different
The recent whim, the project is over, use JavaScript to write a small game, practice and accept it, write a bad also ask heroes to give critical suggestions.
The HTML code is as follows
score: & Lt;div id= "G21" class=
The example of this article analyzes the use of JavaScript scoped chain (scope Chain). Share to everyone for your reference, specific as follows:
About the scope of JS chain, has been heard, and have seen several introductory blog, but has always
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