I’ve worked in a couple of very complex ajax web pages, so I would like to share with you my experiences on what helped me to do them right, and algo what I should have done to make them better and easier to mantain.
Specify supported browser’s and versions
This is a rule before starting any web project. If the project doesn’t specify this I can assure you that the release date won’t be met because:
- QA effort are incremented exponentially
- Code will have constant modifications just so that a specific browser works correctly. This is very dangerous, since the code becomes very cluttered, hard to mantain and also loses focus on business rules and value
- If Internet Explorer 6 support is required, be sure to communicate your sponsors of an extension in the release plan. A very long extension
- These ones are a must. You must have a full fledged library (dojo, jquery or yui are the most widely used).
- Spend some time learning the library’s utility methods, they will save you tons of time
- Dojo, for example, has a great tool which is dojo.query, and also has very powerful and highly configurable GUI components and effects
- jQuery has a very easy to use implementation of ajax, tons of plug ins and is very memory efficient
- Don’t mix up different libraries, since they will probably clash and the resulting bugs can be quite hard to detect.
- Besides, using only one library allows an easier maintenance of the code, and the learning curve is shortened
Become a CSS expert
Unless you don’t care that your code becomes messy, and lacking a common, standardized user interface, become an expert in CSS and make sure that your web pages use it as much as possible.
Define user notification standards ASAP
Also, define how are you going to prevent multi submit’s, either by blocking all buttons, or having the “loading…” message put a gray transparent div over the form to prevent clics.
Avoid GUI tree structures