Content (blogs, articles): Server or JS?

What is the best place to calculate the differences between the two versions of the text (and add the corresponding "deleted" and "added" css classes)?

Should this be done on the server or is it better to have client-side JS?

+3
source share
2 answers

Unless you are doing something crazy, you should not define changes using JS if you are looking at simple DOM content.

You want to use a combination of server code and JS to handle revision checking to create such a system, but classes like removedand addedprobably should be created on the server side.

+1
source

, . , . ( ) (: ) . , , , / , . , - , . , , , - , .

+1

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


All Articles