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
    }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)