⬆️ ⬇️

A sign of waiting for an Ajax response on Habré is, but not used

During the analysis of the site styles, it was discovered in its time that styles and scripts provide for what should be according to the rules of usability - showing the mode of waiting for a response from the server - but it does not manifest itself visually. It works only on pages with a new layout - almost on everyone, except for some specially designed (in the old layout, adopted before October 2011) pages of blogs of companies. So let's use what has been done!



Therefore, when creating user styles ZenComment , the waiting style was involved. It appears after the user has clicked on sending a rating and disappears when a successful response from the server arrives. It does not look very impressive, there are no spinning arrows, because to create special effects - there is already no place in the file, which should be limited to 65 KB for all styles according to the rules of hosting. The symptom appears simply as a pale yellow background of the assessment button. If, for example, the connection with the server is lost, the background of the answer button will remain yellow. Without yuzerstili in this case, nothing happens visually.



The scoring process consists of 3 stages, as it should be when changing content without reloading the page. It is shown how it looks for some comment on the article.





')

Evaluation of the article and evaluation of the comment in the questions-answers will also work.



After the evaluation, the inactive downgrade button disappears, because the style does not show the inactive buttons (or rather, those that have no meaning) after they voted, but the indicator button remains that talks about how they voted. Similarly, the rating buttons will not be displayed if the user is not authorized or the buttons have expired.



An oval that is visible around the assessment is the action of another script, the percent of the answers “for” and “against.”



The experience of using it for about 2 months showed that there was never a case that the presence of a visible state of expectation somehow helped significantly. Just because the method of assessment worked reliably, the Internet, too. Only sometimes a delay of 0.5 seconds was visible and reminded that evaluation was, after all, not an instantaneous action. For example, to take a screenshot, it was necessary to switch the browser to offline mode. But if the connection with the server was interrupted, a sign of waiting would help to know about it.

Source: https://habr.com/ru/post/137202/



All Articles