📜 ⬆️ ⬇️

Double send prevention

In my opinion, a very simple, but very useful improvement: to memorize the text of the last comment sent by the user (or a hash so as not to waste space), and if the following comment is exactly the same, do not create it.

I think no need to explain why.

UPD: I'll explain :)
Situation 1. Inadvertently poking send Ajax two times. The button either does not disable, or does not have time to zadizayblitsya - it is always real. Double post
')
Situation 2. With Opera Mini (this is my script, I think there are other similar ones) I am sending a comment. She thinks for a long time, I decide that the comment did not go, submichu second time. And the comment set off. Double post

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


All Articles