Preface
In this chapter, we will explain 5th of the Five Principles of s.o.l. I. d implemented by the Javascript language and the dependency inversion principle LSP (the Dependency inversion principle ).
Http://freshbrewedcode.com/derekgreer/2012/
Introduction
The last two articles in the deep understanding of the Javascript series have finally been completed. The so-called "complete" is not accurate, because many of the contents have not been written, such as high performance, Ajax security,
Introduction
In a software system, sometimes it is faced with the creation of "a complex object", which is usually caused by the sub-objects of each partAlgorithmComponents; due to changes in requirements, each part of this complex object is often
Introduction
Command is used to encapsulate a request into an object, so that you can parameterize the customer with different requests; queue requests or record request logs, and perform unrecoverable operations. That is to say, the pattern change
Introduction
The template method (templatemethod) definesAlgorithmAnd delay some steps to the subclass. The template method allows the subclass to redefine certain steps of an algorithm without changing the structure of an algorithm.
The template
To sum up this work, I understand several key points:
1. javascript can directly reference the. NET Server-side control, but the problem is that the Control ID will automatically add a namespace after compilation, so pay special attention here.
2.
The HTML Tag contains an IMG tag that is not generally known to developers. Let's talk about its attributes first:
SRC, DYNSRC, start, ALT, controls, loop, loopdelay, heatace, vspace. ... Some common attributes will not be listed,
Here we will
1. Create a script block
1: 2: javas coding code goes here3:
2. Hide scriptsCode
1: 2: 3: Document. Write ("hello ");4: // -->5:
Related code is not executed in browsers that do not support javas libraries.
3 display when the browser
We recommend that you use encodeuricomponent (), get, and post to send the URL encoding of variable values.
There are several methods in JavaScript to encode URL strings: escape (), encodeuri (), and encodeuricomponent (). These encodings play
Javascript is non-typed, which means that its variables can store any type of values. It can be converted quickly and automatically if necessary.Variable Declaration uses var. a var statement can declare multiple variables and separate them with
Statement
Syntax
Purpose
Break
Break;BreakLabel;
Exit the innermost loop or switch statement, or exit the label specified statement.
Case
CaseExpression:
Mark a statement in the switch statement
An object is a composite data type.The simplest way to create an object is your Javascript Code Contains the Direct Volume of objects. You can also create an object by using the new operator.VaR empty ={}; // an object with no propertiesVaR point = {
ArticleDirectory
Syntax
Description
Definition and usage
The Nan attribute is used to reference special non-numeric values.Syntax
NanDescription
You cannot use the for/in loop to enumerate the Nan attribute, or use the delete operator to
ArticleDirectory
Syntax
Return Value
Description
Example 1
Example 2
Definition and usage
The substring () method is used to extract characters of a string between two specified subscripts. Syntax
Stringobject. substring
Javascript escape () returns a reencoded string. Transferred from vnde.cn
Escape () Format
Escape (string)
Escape () Parameters
String is required. String object or text.
Note:
Escape () only compiles symbols and Chinese and English, and then
1) when using the match method, if G attribute is not specified, it is equivalent to the exec method of the Regexp object, rather than an array with only one element.
Example:
VaR STR = "Ahi"; var exp =/A (HI )/;
VaR arr1 = exp.exe C (
Introduction
Proxy, as its name implies, is to help others do things. The GoF defines the proxy mode as follows:
Proxy mode, which provides a Proxy for other objects to control access to this object.
The proxy mode allows the proxy object to control
Http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth.
The module mode is a common JavaScript encoding mode. This is a general understanding, but some advanced applications have not received much attention. In this article,
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.