Scripts not appending to element in AJAX call – why?

This code worked for me:

    success: function (data) {
      var dom = $(data);
      scripts = dom.filter('script').each(function () {
        script = $(this);
        $("head").append(script);
      });
      //...more code
    }