📜 ⬆️ ⬇️

When to use AJAX?

I often see on various not-so-good sites the neglect of ajax. It happens like this: the authorization form transfers the user to a separate page, on which is written in large letters: “ YOU ARE AUTHORIZED! "Or" YOUR MESSAGE WILL BE PUBLISHED AFTER THE MODERATOR TESTS . " Why create such pages really? This page does not carry any useful meaning. Sense load remained on the page from which the user switched in order to write a comment or log in. And now, he may have already forgotten why he did it. I used to do that too when I didn’t know what ajax is. These pages were simply involved in processing the $ _POST parameters, and when the user pressed F5 on that page, the post request was sent again. Even then I understood that something was wrong with this approach, but I couldn’t say what exactly.

Or vice versa - the unjustified use of ajax. For example, for a paginator - this of course can be beautiful but not too functional, you will not share the link with friends, and the search engines, as far as I know, JavaScript is not very digested yet.

And recently, I formalized for myself the rules for the use of ajax, which I follow relentlessly:
')

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


All Articles