about using arrays

about using arrays


Hi everybody,
The essence of my question is this:
if I want to pass an array as a parameter via ajax using Jquery I
should do this:
jQuery.post('radcheck/new', {'user[]':user}, function(result) {
//something here
});
Let's say I have this:
user[0] = 'name'
user[1] = 'surname'
jQuery.post('radcheck/new', {'user[]':user}, function(result) {
//something here
});
Or this other:
user['name'] = 'name'
user['surname'
j] = 'surname'
jQuery.post('radcheck/new', {'user[]':user}, function(result) {
//something here
});
I've done it and works fine. But I thought I could do something I
little bit nicer so I did this:
user.name = 'name'
user.surname = 'surname'
jQuery.post('radcheck/new', {'user[]':user}, function(result) {
//something here
});
but it does not work, the information is not passed to my function. Is
it a common issue?
Thanks :-)
--