Re: [jQuery] Can't seem to return an object - Please Help ASAP

2007-01-29 Thread Christopher Jordan
I know that about blockui, but my only reason for going synchronous would have been so that the calling function would wait until the ajax call had returned. I didn't need to block the interface. The main function was generating a display, but needed an array of user ids from the server. In ste

Re: [jQuery] Can't seem to return an object - Please Help ASAP

2007-01-29 Thread Jörn Zaefferer
Christopher Jordan schrieb: > Thanks so much for responding. I did manage to work around the > problem, by calling the function with the ajax call first and then the > function that uses the return object second. Both ways work, so it's > nice to see that if I do something like that again, I cou

Re: [jQuery] Can't seem to return an object - Please Help ASAP

2007-01-29 Thread Christopher Jordan
John, Thanks so much for responding. I did manage to work around the problem, by calling the function with the ajax call first and then the function that uses the return object second. Both ways work, so it's nice to see that if I do something like that again, I could just add an 'async: fals

Re: [jQuery] Can't seem to return an object - Please Help ASAP

2007-01-29 Thread John Resig
To make your call synchronous, try something like this: if(mode == "edit"){ var userObj = getActiveUsers(); // if I dump userObj here... dump(userObj); // dump shows that userObj is undefined. :o( } function getActiveUsers(){ return eval("(" + $.ajax({ type: "post", url:

Re: [jQuery] Can't seem to return an object - Please Help ASAP

2007-01-29 Thread Christopher Jordan
Yep. Just realized that about ten minutes ago. dagnabbit! :o( Now I've got to rewrite a bunch of code unless I can make this call synchronous. Which at this late hour I'd rather do. Isn't there a way to do that in jQuery? Chris Jörn Zaefferer wrote: Christopher Jordan schrieb: Hi fol

Re: [jQuery] Can't seem to return an object - Please Help ASAP

2007-01-29 Thread Mike Alsup
> I'm really confused why this isn't working. I need serious help... asap! Hi Christopher, You code isn't working because $.ajax is an asynchronous call. You invoke it and give it a callback method (success). That callback method is invoked whenever the server response is received. You need to

Re: [jQuery] Can't seem to return an object - Please Help ASAP

2007-01-29 Thread Jörn Zaefferer
Christopher Jordan schrieb: > Hi folks, > > I have an ajax call that upon success has a variable 'r' 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

[jQuery] Can't seem to return an object - Please Help ASAP

2007-01-29 Thread Christopher Jordan
Hi folks, I have an ajax call that upon success has a variable 'r' 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 v