views:

48

answers:

1

I am trying to get a value of the response I check arguments.length and it says 1 and works but when I do arguments[0].value or arguments[0].responseText it doesnt work...it says undefined....how do I get the values?

+2  A: 

I don't think there's enough information in this question to properly answer you... but I'm guessing that the arguments list isn't of the type you think it is. arguments[0] probably just doesn't have a value or responseText attributes.

Download and install Firebug for Firefox and then console.log(arguments[0]) or just arguments. See what properties it actually has. (or just alert it)

Mark
alert(arguments[0]); gives me [object object]how can I find the value of the object?thanks
The "value" of the object IS [object Object] unless the default `toString()` method is overridden. If you want more info you can query the `constructor` property, but you really should already know *something* about values/objects passed to your function.
MooGoo
@OP: Then try `alert(arguments[0].value)`, although it'll probably tell you `undefined` again. Like I said, install FF/Firebug or at least give us some more info in your question. How are we supposed to know what "arguments" is?
Mark