Immediate response rating systems
March 31st, 2006 in Basic TutorialsWhen you rate snapshots in the gallery of TheBroth, you may have noticed that the result is displayed immediately.
How is that possible? Surely even using Ajax will take some time?
Rating outcome preloading
The trick is quite simple really! When you present your users with rating boxes that will change the rank or average rating of an item, you can already store the possible outcomes in Javascript, when the page is loaded!
In the case of TheBroth, for each item, the page loads the rating data (rank, rating percentage, number of votes) for the item, and the possible rating data in case you rate the item + or -, respectively.
Yes, we still send your response to the server via Ajax, but this way the user gets an immediate response.
You can compare it to “image preloading”, which is being used a lot for dynamic menus that show graphical effects on mouse-over. Even if you never mouse over the menu, both the inactive and the active state images are being loaded.
We do the same with the rating data. It’s only a very few bytes and if you do the same on your site, your visitors will thank you for offering an interactive and highly responsive website.












