• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sending javascript array to server

 
greenhorn
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks eric.

actually the array contains objects.

so this join() is not working.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic