Unfortunately, in order to pass data from the client (web
browser) to the server you need to initiate a server call. This CAN
be accomplished without changing the browser page via AJAX, but it
might be easier to force the user to send data to the server via a
page request or form post.
In plain english - in order to get data to the server from
the browser, you have to send it there. Form submission and AJAX
calls are probably your best bet.