These nine rules are simple, no pieces of code - just general tips for aspiring Ajax developers. Extremely
free translation 9 AJAX Tips & Tricks .
1.
Simplicity - error protectionA simple script for obtaining new data will allow you to avoid a lot of mistakes from nowhere. Write your own, or ask colleagues to share their experiences. But remember, simple does not mean stupid and full of holes.
2.
Use gzipIf the amount of information transmitted is assumed not small - then use compression, this will reduce the time of the script, by reducing the data transfer time. This
page will help you.
')
3.
Plan your developmentIt is impossible to write a serious application with a condo. Plan more, draw out and think through everything you can. It is better if you do this not in the head, but on paper, or in any editor. Good planning saves from a huge number of mistakes and from unnecessary work.
4.
Use standardsThere is absolutely no need to reinvent the wheel. Use what standards give you in developing Ajax applications. Among them, for example,
XML ,
HTML ,
XHTML ,
JSON ,
UED .
5.
Check incoming dataIn this regard, it is possible to be a maniac, not trusting anyone but himself. It is necessary to check instantly, the benefit of instant check scripts, for example, forms, is now the sea. Check on "place" saves time of the user and yours, as the developer.
6.
Check incoming data and serverRemember the maniac? So, do not trust the client-side check - check out the server side as well. Feel free to tell the user that he was wrong there and there.
7.
Use SSL for private information.If you are operating with private information, then you must use
SSL in the order that is necessary to preserve privacy and not blush to users in the future.
8.
FrameworkDo not reinvent the wheel (although if you are just learning - invent, it is extremely useful for developing you - as a specialist) - you have written almost everything that is possible long ago. Use frameworks to save development time. Only without fanaticism.
9.
First basic functionalityDuring application development (especially if you are writing it for yourself), there are often situations when an idea for your application is born on the fly. Do not rush to implement it - carefully write it down, and add what you have planned according to item 3. Later, when everything is ready, put all the ideas together and re-plan how you will implement them.