Page is a not externally linkable
- WebmasterWorld
-- New To Web Development
---- Is client-side scripting essential?


rocknbil - 6:40 pm on Apr 5, 2008 (gmt 0)


I approach the problem like this.

Client-side scripting can be enabled or may not be present in the browser (for example, search engine spiders.) For this reason, anything you do in Javascript must be duplicated or emulated by your server side programming or it is doomed to sporadic failure.

Example: shopping cart that calculates totals directly on the page using Javascript. If JS is disabled, when submitted you get an order for $300 of items but the total . . says $0. And that is the value that is passed to the payment processor. So your server-side programming - php, perl, asp, whatever - needs to replicate exactly what your Javascript does to insure proper calculations.

This, I think, invalidates and answers the question about "we can do the same thing with one or the other".

So to answer the question, Javascript or other client side processing is only essential in the sense that we use it to enhance the visitor's experience on our sites; to perform many of the tasks and speed up the processing of their quest without making an round trip top the server each time. Anything that relies on Javascript to function properly will eventually fail when a user agent comes along in which it's disabled.


Thread source:: http://www.webmasterworld.com/new_web_development/3619731.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com