When to use the client or server side?

I just finished an introduction to a web developer course in my CS program and walked away wondering something simple. When should you use JavaScript (client-side) instead of server-side (we used PHP, but something is applicable)? And vice versa.

+5
source share
3 answers

There is no recipe for making a decision. A few notes:

  • security and validation should always be present on the server side (sometimes duplicated on the client).
  • the client side should contain only UI logic. No business logic.
  • logically, everything that accesses the database must be on the server.

, RIA ( -), . .

+6

Javascript . , , . , - .. .

, :

  • (UI) , . /
  • ( )

, :

  • ( , ).
  • - ( , , )
+2

Imho, I would say use the server side if you can. All client code can be manipulated. Or, it may not work, because the browser does not support it.

+1
source

All Articles