First, single-page writing specification: Remember the page to be divided into modules to write: First module: Receive parameters. [It is possible to submit to the same page from different pages; it may also appear which priority processing of two form items. Second module: Define global variables. The third module: Write processing code (try to include the code into the function, see the page notes.). - The main part of this ASP code is completed. The fourth module: pure HTML code, generates a page with a value stored in the global variable. Fifth (note): Write the page logic on the page header. (How to receive, process.) Advantages: Easy to maintain. The module is independent, which is easy to reuse similar pages.
Second, the whole station document construction specification: 1. After the engineering takes over, first watch the static page, master the logic and browsing order. 2. Extracting the place in the page to be embedded. 3. Extract the header file, the tail file, and the left menu bar to make an embedded file. 4. Divide the page structure and make a template file. - Copy it in the future, then you can use it directly. Note: Don't rush to write a page unless you take over a small project, or if the user needs are very clear and will not change again, otherwise, keep the page code readability is very important! (What is your mood? Let's take a look at the potential danger!) - Because each of us is very clear about the code you wrote, it is more difficult to read the code written by others. And, due to the changes in customer demand, modification and even overturning the original design is more common. So pay attention to keep the later people quickly read and make it easy to modify. ] [At least to add comments on the page head, there is also an important part of the code in the middle of the code, it is necessary to add some explanatory comments. ]
Everything we do is just to: increasing the reusability of portable, making logic clear, easy to maintain, adapt to user needs, and completion as soon as possible, reducing useless work. -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note 1: The third module is written. "ASP page write structure" 1. write a note 2. Write embedding files. 3. Write a block of ASP code (from COM) - Note: Complex pages, try to encapsulate different COM's operation in a separate function; The processing data (already assigned to the global variable) - the legitimacy check is performed before the function is called.
Note 2: The fourth module is written. "1)" 1) of the HTML code section is best not to make the page ASP code and HTML code mix together, - feel compared. 2) Get the processing result of the ASP by obtaining the data of the global variable. 3) About the client JavaScript: The legitimacy test is required before the form is submitted. Written on the drop-down box to have and hide the button synchronization, write a separate small function, place below the button. For large INNERHTML type client interaction, write the code set to the corresponding write client script, can write more functions, make the parameters passing between the functions, simple function, so that there is similar page in the future, you can Remove it again.
Requirements for web pages: Page personnel completed, to ensure that there will be no confusion in use, please do the following processing: 1. Do not nester more; 2. Table width should be used in pixels; 3. In a single page, a function module is to form a table to write a page, extract the repeated part into an embedded file. 4. Other pay attention to: Streamline code, pay attention to the width of characters and borders in the form. 5. Please use English lowercase (and half-horreaded underline) by using the file name. [Think about your page to move to the miserable situation on UNIX host]