Similar to this question: http://stackoverflow.com/questions/337352/jquery-build-html-in-memory-rather-than-dom
I have a
var $container = $("#container");
I also have:
jQuery.fn.somedomedits = function(expr) {
return this.each(function() {
var $self = $(this);
$self.find(".adsf").append("<div></div>");
// A lot more complex dom insertions like this
});
};
Right now I'm doing:
$container.somedomedits().somemoredomedits();
// The somemoredomedits method is a similar plugin to the first one.
Just doing it this way changes DOM directly.
so then I did:
var $editeddom = $container.somedomedits().somemoredomedits();
$containerwrapper.html($editeddom);
Is that the correct way to do this?
I see no speed improvements in Firebug/fox, not sure if it would benefit other browsers.
Thanks