[jQuery] Re: Fetching data from callback with $.ajax

2009-07-27 Thread James
If you want a global variable, set a global variable. var isAuthenticated = false; $(document).ready(function(){ // do your ajax here and set: isAuthenticated = true; // in your success callback }); On Jul 26, 5:27 am, FrenchiINLA mamali.sohe...@gmail.com wrote: I would do like that:

[jQuery] Re: Fetching data from callback with $.ajax

2009-07-26 Thread FrenchiINLA
I would do like that: isAuthenticated function return true or false according the entry, then check if is Authenticated, ajax to your php something like if(isAuthenticated($('#username').val(), $('#password').val())) { $ajax( { -- -- success: function(msg){ alert(msg=='authenticated') } } ); }