Ummm perhaps you left it out of the email but where in
getActiveUsers() do you "return ActiveUsers;"?

Karl Rudd

On 1/30/07, Christopher Jordan <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I have an ajax call that upon success has a variable 'result' that
> contains a JSON encoded string. I eval that string and it becomes an
> object (an array of structures, etc.), but when I try returning that
> object from the function to the caller, something goes wrong. The caller
> says that the value returned is undefined.
>
> so...
> if(mode == "edit"){
>     var userObj = getActiveUsers();
>     // if I dump userObj here...
>     dump(userObj); // dump shows that userObj is undefined. :o(
> }
>
> ...
> function getActiveUsers(){
>     var ActiveUsers;
>     $.ajax({
>         type: "post",
>         url: "GetActiveUsers.cfm",
>         datatype: "html",
>         data: "",
>         success: function(r){
>             r = CFJS.Trim(r);
>             ActiveUsers = eval("(" + r + ")");
>             // if I dump the object here (using that very cool dump.js code)
>             dump(ActiveUsers); // I get exactly what I expect to see --
> an array of structures.
>         },
>         error: function(){
>             alert("There was an error retrieving the list of active
> users.");
>         }
>     });
> }
>
> Help! :o(
>
> I'm really confused why this isn't working. I need serious help... asap!
> :o( :o(
>
> Chris
>
> --
> http://cjordan.info
>
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to