henever bạn xây dựng và chỉnh sửa các trang web trong Dreamweaver - đặc biệt là nếu bạn đang mã hóa hoặc dán nội dung một số đánh dấu có thể nhận được đông đúc với các thành phần dư thừa và mã không cần thiết hoặc không mong muốn. Bạn cần để loại bỏ các bit thêm mã từ tất cả các trang trước khi bạn xuất bản, cho dù bạn làm điều đó trước (ưu đãi thiết lập), | Chapter 2 Keeping Your Code Clean ỉn This Chapter Changing code preferences Running the Clean Up Word HTML XHTML command Performing a spell check Cleaning code with the Clean Up HTML XHTML command Applying source formatting to your pages Externalizing your JavaScript Updating links sitewide t y Whenever you build and edit Web pages in Dreamweaver especially if you re hand-coding or pasting content some of the markup may get crowded with redundant elements and unnecessary or unwanted code. You need to remove those extra bits of code from all the pages before you publish whether you do that in advance by setting preferences during page creation by selecting paste and import options or as a final code cleanup with Dreamweaver s HTML XHTML Clean Up spell check and other code reporting tools when the site is complete. Why Actually you should clean up your code for a few reasons. One that extra code adds to the overall file size which in turn can affect page-loading times in a browser. Two badly formatted code may confuse some browsers causing the information on your pages to display less accurately than you intended. Even more important perhaps is the fact that some code errors can prevent browsers from displaying the HTML or XHTML entirely. If these issues aren t enough to convince you to clean up your code before publishing you ve been warned. At least think about keeping your code as clean and error-free as possible as a reflection of your professionalism. After all anyone can look at your Web site code by simply using View Source. So how do you go about cleaning up your Web site code without having to review the code in each file line by line Fortunately the answer can be as simple as running a few quick commands in Dreamweaver. First set up a few Dreamweaver preferences to avoid some of the issues. If you ve already created your site you should still set up Dreamweaver s preferences so any new documents you create use these settings. 502 Eliminating Formatting .