|
Posted by Toby Inkster on 01/18/07 17:31
aa wrote:
> "Toby Inkster" <usenet200701@tobyinkster.co.uk>
>
>> Indeed -- and that is a nicity. It's possible to combine server and client
>> side scripts in such a way that the function is calculated at client side
>> when possible, and if this fails will fall back to a server side routine.
>
> I am confused. Earlier someone said that JS should only be used for nicities
> which might not be available without loosing functionality
> what sort of calculation a function is going to do?
The sort of functions I'm referring to are things like form validation
(i.e. checking that the form has been filled in correctly), totalling up
prices and other functions where a bit of client side script can return an
answer much faster than a server-side script.
When Javascript is not available in the browser, these forms are simply
submitted to the server and checked there -- as per my earlier example of
a simple function to add two numbers together.
The server is often also capable of more sophisticated form validation, so
you might want to do a check with Javascript first to catch any obvious
errors (empty fields, etc) with further checks on the server to catch
errors that would have been difficult or impossible to detect at the
client end (e.g. non-existing product code, invalid user name, spelling
error).
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|