jquery - $.couch.db().openDoc() & db.getDoc are asynchronous, right? -


trying call methods of subject , works splendid, reach whatever info needed docs requested within methods. want use information outside of methods , whenever try variable come out undefined.

from have read these methods asynchronous , hence undefined result.

so, how solve it? doing $.ajax({.. async:false..}) kind of works against purpose, *a*jax *a*sync. suggestions, except q&d async:false option?

after litt. studies , hack-arounds, solution:

use $.ajax({async:false}); , call in fork (web worker) avoid lockdown.

it aint pretty - works.

still: there pretty solutions out there?

edit: there prettier solutions out there , solutions instead of have written above. called 'callbacks' , had not understood concept until now. if don't want mistake please invest few minutes here , save hours of agony.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -