It must be simultaneously appeared simultaneously with its shutdown tag. Such as
... ... .... font> .... p> .... body>
* No cross-included statements, such as:
... .. p> font>
1.3 Tag properties assignment specification
For tags that receive attributes, attribute values must be surrounded by double quotes or single quotes. Such as:
1.4 Tagged indentation specification
* The highest level of parent label is written in the left side of the top.
* The next level marker uses the left to right to turn right to write a TAB.
In the next level, the left alignment is written in a TAB to the parent label, respectively.
* The first character must be aligned above the same level.
2. Client JavaScript specification
2.1 variable naming specifications
* Constants and global variable names must all use uppercase letters
* Variable first letters must be lowercase.
* Variable Name must start using its type of writer. Various types of writings are as follows:
* Integer variable: int
* Long integer variable: LNG
* Floating point variable: flt
* Double precision variable: DBL
* Object reference variable: OBJ
* String variable: STR
* Date type variable: DTM
* Variable names must be named after meaningful words, such as:
StruserName, LNGARRAYINDEX
* Variable name except the initial letters, other words must be capitalized
* If the variable name can use word abbreviations, in addition to the extensive word abbreviation, all variable names written written by words must be annotated when defined, such as:
Var stradname // is used to represent the name of the Administrator account
Var stradminname // Don't give a notes, Admin is widely understood 2.2 variable usage specification
* You must be defined before the variable is used. No defined variables are forbidden to use
* Use of variables to narrow down to small scopes. Such as recycling
FOR (var i = 0; i <12; i ) {
}
Instead:
Var i;
For (i = 0; i <12, i ) {
}
2.3 Object Naming Specifications
Various page objects such as the Text input box, buttons, the drop-down selection box must use the following corresponding prefix when naming:
* Text input box: txt
* Button Button: BTN
* SELECT drop-down selection box: SEL
* Option item: OPT
* Form form: FRM
* Frame Frame: FRA
* Hidden form: HDN
* DIV tag: DIV
* Span tag: span
* Dialog Object: DLG
* Window object: WIN
2.4 Function and sub-process naming specification
* Function Naming must use verbs noun pair, and enable functionality
* The verb prefix named by the function must be the full verb related to the function function.
* Function names the first letter lowercase of the first word, the first letter of each word
Chapter 3 Dynamic File Coding Specification
HTML writing specification
HTML writing specification must comply with static files HTML markup specification, reference (Chapter 2, Section 1)
2. Client script specification
Dynamic file client scripts will be written in JavaScript and must meet the provisions of JavaScript coding specifications in static file coding specifications (refer to the second section of the second section)
3. Server-side script writing specification
Server-side script writing with VBScript writing
3.1 Name Specification
3.1.1 VBScript scripting variable naming specification
* Constants and global variables must be used in uppercase letters
* Constant must use const_ prefix
* Global variables must use G_ prefix
* Variable first letters must be lowercase.
* Variable Name must start using its type of writer. Various types of writings are as follows:
* Integer variable: int
* Long integer variable: LNG
* Floating point variable: flt
* Double precision variable: DBL
* Object reference variable: OBJ
* String variable: STR
* Date type variable: DTM
* Variable names must be named after meaningful words, such as:
StruserName, LNGARRAYINDEX
* Variable name except the initial letters, other words must be capitalized
* If the variable name can use word abbreviations, in addition to the extensive word abbreviation, all variable names written written by words must be annotated when defined, such as:
DIM stradname 'is used to represent the name of the Administrator account
Dim stradminname 'doesn't have to give an comment, and Admin is widely understood.
3.1.2 Object Naming Specifications
Various objects such as Connection, RecordSet, command must use the following corresponding prefix when naming:
* Connection object: conn
* Recordset object: RS
* Command object: cmd
* Parameter object: param
* Field object: FLD
* Error object: ERR
3.1.3 Function and child process naming norm
* Function Naming must use verbs noun pair, and enable functionality
* The verb prefix named by the function must be the full verb related to the function function.
* Function names the first letter of the first word, back every word of each word
3.1.4 Common variable naming specifications:
Description: The portion contained in [] is a canable portion * Connection object: conn [name]. Name is the server name for the connected database
* Recordset variable naming specification: RS [name]. Name English word combination related to customized with RS storage
* Command object: CMD [Name]. Name is a custom-related word combination related to COMMAND purposes
* SQL statement string variable: strsql [commandName]. CommandName is a custom-dependent English word combination with SQL statements, such as:
strsqlupdatemodify
strsqlinsertuser
3.2 Code Writing Specification
3.2.1 Variables clearly declare principles
* All ASP program files must contain <% Option Explicit%> in the first line of the code. Change to variables to clearly declare mode
3.2.2 Character set setting principle
* All ASP program files that will generate Chinese output to the client must set the charSet as "GB2312" before the output. Such as: response.charset = "GB2312"
3.2.3 Function Use Principles
* Try to use the function package code block
* Continuous code blocks should not exceed 50 rows as much as possible. Do not exceed 70 lines
* Try to use local variables.
* If there is a global resource, such as Connection, try to introduce as a function of functions
* All the open resources created inside the function must be turned off before exiting the function. Such as: Recordset, Command
3.2.4 Request, Session, Application Specification
* All the objects that need to be placed in session, Application must use meaningful English name. In addition to the extensive word abbreviation, words should not be used. Such as:
Session ("cp") = strcurrentUserip 'is not allowed
Session ("currentuserip") = strcurrentUserip
Session ("PWD") = strpwd 'Allow, PWD is widely understood as password
* All Elements that need to be used in the code, session, Application elements must be assigned to the variable declared within the code in the code header.
* If you get the content submitted in Form, you must use Request.form ("ItemName").
* If you get the content submitted in querystring, you must use Request.QueryString ("ItemName")
* Request ("") in the code must not appear in the code.
3.2.5 HTML with server-side script mixing principles
* Server-side script tag "<%" must be left to the mark close to the mark, such as:
<%
Do While Not Rs.eof
%>
TEXT TD>
TR>
<%
rs.movenext
loop
%>
table>
* Server-side script tag "<%" is not written in the same line with the same line
* "%>" Do not write in the same line with the code in front of it
* Server-side script tag "%>" is aligned with its nearest "<%" tag
* HTML code inside the server is written in accordance with the HTML indentation rules of static files, and does not follow the server-side script indentation rules.
* HTML tag internal code, according to the indentation rules of the server-side script, do not follow the HTML code indent rules
Chapter 4 Frequent Error
1. ADO's transaction
1.1 Error Code: 80004005.
1.1.1 Error Description:
Microsoft OLE DB Provider for ODBC Drivers Errors '80004005' Cannot start transactions in Firehose mode
1.1.2 Solution:
When starting ADO's transaction, you must first turn off the record set that is opened using the same connection object, or set the cursor set position type as aduseclient before opening those cursors. (Using the client game set)
Chapter 5 Code Customs Writing Example
1. Use of ADO objects
1.1 AdoDb.Connection object
1.2 AdoDb.command object
1.3 AdoDb.Recordset object
1.3.1 Creation:
SET RS = Server.createObject ("AdoDb.Recordset")
rs.cursorlocation = aduseclient
RS.Open strsql, conn, 1 [, 1] 'must specify the cursor type
转载请注明原文地址:https://www.9cbs.com/read-91497.html
|