function - Make jQuery Wait For $.post to complete updating page -


i calling function refresh part of current page jquery.post - , after function completes need execute function updates google map on page, using updated html written out $.post

i cannot nest functions because dogooglemap() won't work within scope of refreshsubdivisionlist() function.

how make wait $.post finish writing updated html page before calls dogooglemap() function?

function refreshsubdivisionlist() {      var formactionscript = jquery("#refreshsubdivisionform").attr('action');      jquery.post(formactionscript, jquery("#refreshsubdivisionform").serialize()).done(function(data) {          jquery(".subdivision-list").html(data).show();      }, 'text');      return true;  }   jquery("#refreshsubdivisionform").submit(function(event) {      event.preventdefault();     jquery.when( refreshsubdivisionlist() ).done(function(){         jquery('#map_canvas').gmap('destroy');         dogooglemap();     });      return false;  }); 

you can place dogooglemap(); directly in done callback of post, can't you?

then load maps 1 post completed.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -