Hello Peer, Sure it can be done ... have a look at JSON.stringify() at http://www.json.org/js.html, this will turn the Javascript object into JSON text.
On the server-side you need to use JSONTokener and JSONObject see http://www.json.org/java/index.html to convert back to a Java object If you need more help let me know Regards Toby 2008/8/5 Peer Brink <[EMAIL PROTECTED]> > Hello, > > I try to transmit the users/browsers timezone-offset to the server. > The timeZone-offset can easily be retrieved by > > <script type="text/javascript"> > var offset = new Date().getTimezoneOffset(); > </script> > > But how can it be transmitted? Could this be done using a JSONObject > by adding "Object.toJSON(offset);"? > > I found quite some conversations in the mailing-list about > JSON-communication but they are all about transmitting data in the > other direction (server to client). > > Where would the code go in the html-source and what java-code is > needed to receive the value on the server-side? > > Or is there a complete other way to get this value? > > Sorry for this rookie-question. But I am not too familiar with > java-script and JSON. > > Thanks for any help, > Peer. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
