[jQuery] Re: How can I return some value in jquery's callback function?

2008-11-13 Thread Michael Geary
The $.getJSON callback function is not called at the time you make the $.getJSON call. It's called asynchronously, much later, after the data has been downloaded. The return value from the callback is discarded - there's no one to return it to. Did you want to take two different actions

[jQuery] Re: How can I return some value in jquery's callback function?

2008-11-13 Thread Freshow
Yes, it work but I want define the total as a function be called by different var url, and do different actions judge by true or false returned, any way can realize it ? On 11月14日, 上午1时41分, Michael Geary [EMAIL PROTECTED] wrote: The $.getJSON callback function is not called at the time you

[jQuery] Re: How can I return some value in jquery's callback function?

2008-11-13 Thread Erik Beeson
I'm not quite understanding you, but it seems like you need to just pass along callback functions? Maybe you want something like: function checkRegistered(email, doIfRegistered, doIfNotRegistered) { var url='http://localhost/coudou/check/register.php?email=' + email;

[jQuery] Re: How can I return some value in jquery's callback function?

2008-11-13 Thread DYH1919
Just it! I didn't remeber pass function Thank for your reply. 2008/11/14 Erik Beeson [EMAIL PROTECTED] I'm not quite understanding you, but it seems like you need to just pass along callback functions? Maybe you want something like: function checkRegistered(email, doIfRegistered,