How can I standardize a large website? _ CSS/HTML

Source: Internet
Author: User
How to standardize large websites asp development specifications

I. Single-page writing specifications:
Remember to write the page in modules:
Module 1: receive parameters. [It is possible to submit from different pages to the same page; or it is possible to see which of the two form items takes priority ).
Module 2: define global variables.
Module 3: Write and process the Code. (try to include all the code in the function. For details, see note 1 on the page ). -- The asp code is mainly completed.
Module 4: html code, which uses values stored in global variables to generate pages.
Fifth (Note): You must clear the page logic in the page header. (How to receive and process .)
Advantage: easy to maintain. The module is independent and easy to reuse on similar pages.

Ii. Full site file construction specifications:
1. After taking over the project, you can view the static page to learn the logic and browsing sequence.
2. Extract the places on the page that are reused to form an embedded file.
3. Extract the header file, tail file, and the left-side menu bar to make the embedded file.
4. Divide the Page Structure and create a template file. -- Copy it later, and then you can directly create it.
Note: Do not rush to compile pages. Unless you take over a small project or your requirements are clearly identified and will not be changed, it is very important to keep the Page code readable! (How do you feel when you are dealing with big rework? Consider the potential dangers first !)
-- Because each of us is very familiar with the code we write, it is difficult to understand the code written by others. In addition, it is common to modify or even overturn the original design due to changes in customer requirements. Therefore, when writing code, you must note that it is easy for later users to understand and modify the code.] [At least add comments to the page header, and add descriptive comments to the important part of the code.]


All we do is to: increase portability and reusability, make logic clear, and facilitate maintenance,
According to the reason why the first half of the population was not involved, the first half of the population was involved?
――――――――――――――――――――――――――――――――――――――

NOTE 1: The third module provides instructions. ASP page compiling structure
1. Write comments first
2. Write the embedded file.
3. Write large ASP code (extracted from COM)
-- Note: For complex pages, try to encapsulate different COM operations in independent functions;
-- There is a call at the end of the function, and the data processed by the function is directly read (the data has been assigned to a global variable) on the subsequent page)
-- Before calling a function, check the validity of the page entry parameters.

NOTE 2: Write instructions in Module 4. Notes for Html code
1) it is best not to mix the asp code and html code of the page together-it feels messy.
2) obtain the asp processing result by obtaining the global variable data.
3) about client javascript:
Check the validity of the form before submission. Write in the drop-down box to synchronize with the hidden button, write a separate small function, and put it under the button.
For large innerHTML client interaction operations, you can write more functions when writing the code in the corresponding client script so that the parameters passed between functions are simple and the functions are single, so that a similar page can be removed and used later.
---------------------------------------

Requirements for creating web pages:
To ensure that no confusion occurs during use of webpages completed by webpage personnel, ask them to do the following:
1. Do not nest too many tables;
2. The table width should be specified in pixels;
3. In a single page, a function module is used as a table to extract duplicate parts into an embedded file when writing a page.
4. Other considerations: streamline the code and pay attention to the width of characters and borders in the table.
5. Name the file name in lowercase with numbers (and underscores. [Think about the tragedy of migrating your page to a unix host]


>>> 5. Name the file name in lower case and with numbers (and underscores. [Think about the tragedy of migrating your page to a unix host]

I have never paid attention to this point. I name it like this:
EditNews. asp
DelNews. asp

It seems to be written
Edit_news.asp
Del_news.asp is better.

----------------------------------------

I also want to add the following code specifications:

1. A lot of people have not noticed it. I would also like to suggest it: Please write one more space on both sides of the operator. Comparison:
A = (B * c/d + 3.243) & "sdfsdfsdflkj" & "asdsd"
And
A = (B * c/d + 3.243) & "sdfsdfsdflkj" & "asdsd"
The difference in readability. It is self-evident.

2. Correctly indent the code according to the logic!
Example:
If a = 3 then
Response. write "test"
Else
Response. write "sdfsdf"
End if
''-------------> Note that a blank line is reserved between two logical statement blocks.
Do while not rs. eof
Response. write "test"
Rs. MoveNext
Loop

Example of an error:

If not rs. eof then
Response. write ""
Else
Response. write "sfldfsd"
End if
If a = 1 then
If B = 2 then
C = "sdfkgkgskldf"
If d = "dfs" then
E = "sdf"
End if
F = "sdlkfsldfk"
End if
For I = 0 to 100
Response. write I
Next
End if

According to my observation, the above Code habits account for at least 80% of asp programmers, and I am not exaggerating at all.
Let's take a look. Can you understand the above Code. I see this is big.


As for the number of indentations, I am used to it. Generally, two or four cells are used. I personally use asp/vb 2 lattice, js/c style 4 Lattice

Annotation + indent + standard naming
The above three points are really important.
--------------------------------------

All are indented by tab, and can be set in the editor with better number of indented cells.

Try not to output html code in response. write

If Option Explicit is not used, this function is not applicable to web applications.


In terms of development programs, developing programs with DreamweaverMX should speed up the development efficiency of some programs (such as ASP, PHP, JAVASCRIT, etc.) because of the highlighted display and standard character prompt functions.
In terms of page design, PHOTOSHOP is a good tool. PHOTOIMPACT is also a good page design tool.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.