Re: [SLUG] Javascript Problem

From: Daniel Jarboe (daniel.jarboe@gmail.com)
Date: Mon Oct 16 2006 - 00:22:46 EDT


> For example, it you take out the if test and just convert the input to a
> number directly.

If you eliminate all the input validation, you are left with

number=parseInt(source.value,10)

To give you some understanding of the road you are choosing:

Client event triggers javascript which will initiate a XMLHttpRequest
to your server (asynchronously, so the UI doesn't get hung up while
the request makes its way back to the server and your server-side
figures out how to respond).

The server will process the request (perform your DB work and what
have you), and return a response, the arrival of which will trigger
whatever you specified for your javascript XMLHttpRequest callback
function, which will take action to update the UI appropriately.

During all that you will need to take care in dealing with things
like: what the user is doing while you are waiting for the server
response (and perhaps sending additional requests for your server?),
what happens if you don't get a server response, etc. Javascript is a
big part in your charted path, so I highly recommend getting a better
understanding of the language before you start writing too much.

Good luck,
~ Daniel
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:00:50 EDT