aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes sending javascript array to server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "sending javascript array to server" Watch "sending javascript array to server" New topic
Author

sending javascript array to server

pooja jain
greenhorn
Ranch Hand

Joined: Jan 12, 2005
Posts: 213
hi,

i want to send a javascript array to the server side.

is this the good way of doing this:


and at server side, i can retrive from request.

any inputs?

thanks in advance.
[ September 26, 2007: Message edited by: pooja jain ]

:d
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61612
    
  67

Please be sure to use UBB code tags when posting code to the forums. Please read this for more information.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
pooja jain
greenhorn
Ranch Hand

Joined: Jan 12, 2005
Posts: 213
Originally posted by Bear Bibeault:
Please be sure to use UBB code tags when posting code to the forums. Please read this for more information.


done.

is this the better way guys?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
form elements should not start with a number. It would proabbly be easier to retrieve on the server if you ended up using the same name.

Persoanlly I would do a myArray.join() and put it into one hidden field and split it on the server.

Eric
[ September 26, 2007: Message edited by: Eric Pascarello ]
pooja jain
greenhorn
Ranch Hand

Joined: Jan 12, 2005
Posts: 213
thanks eric.

actually the array contains objects.

so this join() is not working.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61612
    
  67

Originally posted by pooja jain:
actually the array contains objects.


What kind of objects? You can only send strings to the server (or files, if doing a file upload). What would be the purpose of sending JavaScript objects?
 
Consider Paul's rocket mass heater.
 
subject: sending javascript array to server