• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending javascript array to server

 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use UBB code tags when posting code to the forums. Please read this for more information.
 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks eric.

actually the array contains objects.

so this join() is not working.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic