Skip to content

Instantly share code, notes, and snippets.

@iamnoah
Created July 25, 2012 13:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamnoah/3176323 to your computer and use it in GitHub Desktop.
Save iamnoah/3176323 to your computer and use it in GitHub Desktop.
WriteCapture2 multiple writes in sequence
var lastWrite = $.Deferred();
lastWrite.resolve();
$.fn.write = function(html) {
return this.each(function() {
var def = $.Deferred();
var el = this;
lastWrite.then(function() {
writeCapture(el,function() { def.resolve(); }).close(html);
});
lastWrite = def;
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment