Some ideas for processing scripts and styles in WEB Project Development

Source: Internet
Author: User

When you use scripts or styles to develop web projects, you will inevitably encounter some "error causes". Of course, if your project is not very large, it may not be very difficult. at most one to two hours, you can solve the problem. However, if your nightmare is approaching when you modify and complete a part of scripts and styles in a slightly complex system, let's briefly describe that during this period, I hope you can avoid detours and go straight to the topic:

 

(1) first, define the functions or styles you want to complete? That is, if you have a model in your own mind, it is not easy to achieve this function perfectly, you must fully understand your requirements.ProgramIf the manager is in charge of the demand, there will be so much communication, more negotiation of the actual needs of this part of the function, and adjustment of the Scheme Based on the implementation difficulty and time schedule, and finally determine an executable demand scheme, don't underestimate this step. Although this step is troublesome, it can save you from a lot of troubles later.
 
(2) then, you can start the project. Do not blindly modify it in the original project. For the reason, please refer to it later. Create a new project, add a new test page, and implement the scripts or styles you want to implement one by one @...... % After encoding, the functions or styles to be implemented have been basically formed. Of course, if there are many scripts, we still need to test more to minimize some bugs. As for styles, you can temporarily write it to the page and then sort it out.

 

(3) Let me explain it first. It is recommended that you compile the implementation in the new project.CodeThe reason is to eliminate some invisible effects in the original system, such as global style control and global script adjustment, and the pages you need to modify may have some hidden risks, your modifications may cause a lot of chain reactions, etc. Of course, if you think the above problems are not a problem, you can also modify them directly on the original page.

 

(4) Add the implemented function or style code to the page to be modified. Do not "objectize" the script or save the CSS file as another one, the first thing to ensure is that the page can work normally, not that you can implant code that can work without worry. The problems mentioned above must be checked one by one, first, perform a function test based on the actual page data. (Of course, if the Code cannot work normally, you have to handle it yourself. Is it estimated that "{" is missing?), Please do a good job in unit testing, because the actual data may be different from the data we tested. Although the format is uniform, the content may be different, which may also cause many problems. Of course, not every time. ...... ¥ % ...... ¥ ...... After integration, the code can work!

 

(5) Finally, I want to check in code. Stop! Do not be busy updating the Code. Although your code can already work properly, is it consistent with the original requirement discussion? Sometimes it is difficult to explain, so before updating the Code, please meet the requirement again to confirm whether the function meets the requirements. In general, you may need to make some adjustments, the problem is not big, but if your first step is not well done, you should understand your current situation.

 

(6) Can I update it at last? Of course, there are some small work to be done. First, adjust the format of the modified script. Of course, if you like objectization, You can adjust its structure. Of course, note the need to add key annotations. For styles, if only one page is used, no CSS files are saved. For personal requirements, if they are useful on multiple pages, it is recommended to save it as a CSS file, because the advantages of CSS can be reflected. At the end, if you are interested, save this part of code to your own code repository first, for future use.

 

(7) you can update the code.

 

The above are some of my thoughts and I hope to help you ~

 

Related Article

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.