I checked a lot of information and concluded as follows:
CopyCodeThe Code is as follows: function orientationchange (){
Switch (window. Orientation ){
Case 0: // portrait
Case 180: // upside-down portrait
// JavaScript to setup portrait View
1. The factory mode abstracts the process of creating a specific object, but the class cannot be created in ECMAScript. Therefore, a function is used to encapsulate the details of creating an object with a specific interface. Take the following
First look at the figure:
A simple Effect
First, html
Copy codeThe Code is as follows:
CssCopy codeThe Code is as follows: ul, li {margin: 0; padding: 0 ;}Ul {position: relative;
1. Sorting:The default sort () is sorted by character encoding:
Copy codeThe Code is as follows:
Now we want to sort it by numerical value:Copy codeThe Code is as follows:
You only need to pass a comparison function to sort. If the value of the
L ECMAScript, defined by ECMA-262, defines the rules and conventions of the javascript language, such as the rules, specifications, and conventions specified for the start of a game.
L DOM: provides methods and interfaces for accessing and operating
This article describes the considerations when using exec in Javascript for global matching of regular expressions.
Let's take a look at common usage:
Copy codeThe Code is as follows:
Next, let's take a look at the strange events in global
If this parameter is not added, it seems that only ie6 has encountered problems. See: changed the image address, the image disappears, the style is loaded, but the style file is gone. Just like the download of A resource is interrupted. The correct
Original code:
Copy codeThe Code is as follows: // convert text to hexadecimal
Function textToSix (str ){
Return escape (str). replace (/%/g, function (){
Return "\\";
}). ToLowerCase ();
}
After improvement:Copy codeThe Code is as follows: //
The full use of object-oriented design ideas in JS can greatly improve code reuse, reduce coupling between modules, and improve logical hierarchy and parallel development. The following describes my understanding in several steps.
I. Data Types and
IsNaN Function
Returns a Boolean value indicating whether the provided value is a reserved value NaN (not a number ).NaN: Not a NumberIsNaN (numValue)
The required numvalue parameter is the value to check whether it is NAN.
Description
If the
The DOM Document Object Model is an HTML and XML application interface (API). DOM plans the entire page as a document composed of nodes. DOM objects give developers access to HTML, and enable developers to process and view HTML as XML documents. The
In this article, the author introduces seven different JavaScript syntaxes in IE and Firefox.
1. CSS "float" Value
The most basic syntax for accessing a given CSS value is: object. style. property, replace the value with a connector using the
Its low learning threshold makes many people refer to it as a pre-school scripting language. Another thing that makes people laugh at is the concept of Dynamic Language, which uses a high standard of static data. In fact, you and Javascript both
1. Simple Type
Simple javascript types include numbers, strings, Boolean, null, and undefined values. All other values are objects.
2. Object
Objects in javascript are variable key sets. In javascript, arrays, functions, and regular
1. Identifiers and keywords
An identifier starts with a letter and can contain letters, numbers, and underscores. The following reserved characters cannot be used for identifiers:
Copy codeThe Code is as follows: abstract, boolean, break, byte, case,
The function object in js is a fascinating thing, but it is often confusing because it is too flexible. I will post some code below:
Most people are abbreviated as follows:Copy codeThe Code is as follows: function test (){}
The entire book
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