How to invoke ready function on appended code

How to invoke ready function on appended code

Hello,
I have in "ready" function code:
  1.     (function () {
            var $args = {};

            if (
                $(window).width() < 1010
            ) {
                $args = { text: false };
            }

            var onEach = function () {
                var $style = $(this).attr("style");

                $(this).button($args).attr(
                    "style",  $style
                );
            };

            $("INPUT[type=submit], BUTTON, .button").each(onEach);
        })();
In different place I append HTML like this:
  1.             $("#template-products_in_document").tmpl(
                    $data
                )
                .prependTo(
                    $("#productsInDocument FORM").empty()
                );
In new code I have button, but "ready" function is not invoked and my button not changed to jQueryUI Button. How I must change JavaScript to change button to jQueryUI Button? I don't want copy code from "ready" function to "done" function in Ajax.