AJAX, if properly used, can reduce significantly the stress caused by the overused click-wait-reload model. In its essence, AJAX should be used to provide the instant feeling of immediate responsiveness. A user clicks and something immediately happens without page reload. However, there are some best practices to follow:
- Always provide a fallback mechanism in the case that an AJAX request doesn't work.
- Provide descriptive and user-friendly messages.
- Make all page actions self-evident through a proper labeling and styling.
- Instant validation.
- Instant user messages.
- Progressive display of fields.
- Handling of the
- Inline suggestions during typing.
All these features should be carefully developed following these best practices:
- Provide descriptive error messages.
- Provide descriptive info messages.
- Handle keyboard navigation through a proper use of events.
- Don't use
return false;on form submission, but always use the
preventDefault()method of the
- Hide only the fields that a user won't fill out.
- Use AJAX to provide suggestions during typing. This is especially useful on search forms.