Author: jxdawei
Jxdawei blog: http://www.iwcn.net/
This article discusses the websiteProgramStaff positioning and how to work with designers to develop website projects that comply with web standards.
This article is applicable to programmers who are not very clear about the division of labor in the traditional table layout.
1: Learning Web standards makes your work easier.
Web standards are the trend of the times, so as a web programmer. You must be brainwashed and learn web standards. Re-recognize HTML tags to learn how to make the program output what the page needsCode.
For example:
The above is the art, and the following is the standard program code:
Dim ohtml
Set rs = server. Createobject ("ADODB. recordset ")
SQL = "select top 10 ID, title from tbl_news order by ID DESC"
Rs. Open SQL, Conn, 1, 1
Ohtml = "<ul>"
Do while not Rs. EOF
Ohtml = ohtml & "<li> <a href =" "shownews. asp? Id = "& RS (" ID ") &" Title = "& RS (" title ") &" ">" & RS ("title ") & "</a> </LI>"
Rs. movenext
Loop
Ohtml = ohtml & "</ul>"
Rs. Close
Set rs = nothing
Response. Write (ohtml)
In the traditional table layout, programmers need to write a lot more HTML code, to write a table, to determine when to output TR for line feed, to add an IMG in front of each news to output small icons, to control the length of the output title using a program. All work requires the code to go out of the page before the programmer can write this program.
For programmers, you should regard web standards as a good news. You should read it like a bible to understand what page code really needs. After understanding it, you will find out. You are much easier than before. Because web standards focus on the separation of performance and content, the program is only responsible for content data. From then on, you no longer need to consider how to use the program code to control the color changing of the line, the number of output columns in a row, and so on. What you need to do is to output the most direct content to the page without any decoration.
Of course, if you use. Net for development, you can be more thorough. You can focus entirely on Object creation, class libraries, and data access, and provide methods to the presentation layer. The example below is my previous project, which should be of reference value.
2: website programmers, do not let HTML tags block your sight.
If you think you really hate complicated HTML tags and your learning direction is not on the website's performance layer, say goodbye to HTML tags.
I used to work in traditional desktop software development companies, where programmers did not know HTML, and I had to ask them for help when my website project was tight. We will take several examples of Visual Studio. NET 2003 for careful analysis, according to the object-oriented structured hierarchical development mode, can also be very good cooperation. Take the development of the News Module as an example:
Step 1: Website programmers can analyze databases as needed. You can create tables and write stored procedures. Programmers are very familiar with such things.
Step 2: Defines an object. Visualize the website information, for example:
Public class News
Protected _ id as integer
Protected _ typeid as integer
Protected _ title as string
Protected _ author as string
Protected _ Original as string
Protected _ updatetime as datetime
Protected _ content as string
Protected _ clickcount as integer
Public property ID () as integer
Get
Return _ id
End get
Set (byval value as integer)
_ Id = Value
End set
End Property
Public property typeid () as integer
Get
Return _ typeid
End get
Set (byval value as integer)
_ Typeid = Value
End set
End Property
Public property title () as string
End Property
Public property author () as string
End Property
Public property original () as string
End Property
Public property updatetime () as datetime
End Property
Public property content () as string
End Property
Public property clickcount () as integer
End Property
End Class
In this way, all the tables on the website are processed as objects. Then define the record set related to the object, which defines a single news object and a news record set.
Public class newss
......
End Class