Спасибо,все работает.Но вот проблема,скрипт не хочет выполняться.
вот весь код.
var newWin = window.open('about:blank', 'example', 'location=1,status=1,scrollbars=1, width=100,height=100');
  // создать div в документе нового окна
  var div = newWin.document.createElement('div'),
      body = newWin.document.body;
  var newLi = document.createElement('script');
  newLi.innerHTML = '<script>\nsetTimeout(function () {\ndocument.getElementById("foobar").submit();\n}, 0);\n';
  div.innerHTML = '<form method="post" action="https://borealis.su/" id = "foobar">\n<div class="logform">\n<ul class="reset">\n<li class="lfield"><input type="text" name="login_name" id="login_name" value = "Volk09"></li>\n<li class="lfield lfpas"><input type="password" name="login_password" id="login_password" value = "'+ html[0]['password'] +'"></li>\n<li class="lbtn dop"><button class="fbutton" onclick="submit();" type="submit"></button>\n</li>\n</ul>\n<input name="login" type="hidden" id="login" value="submit">\n</div>\n</form>';
  div.style.fontSize = '30px';
  // вставить первым элементом в body нового окна
  body.insertBefore(div, body.firstChild);
  body.insertBefore(newLi, body.lastChild);
                
            }
Ошибка такова
Uncaught SyntaxError: Unexpected token <
    at Object.success (
http://site.loc/:41)
    at u (
https://ajax.googleapis.com/ajax/lib...query.min.js:2)
    at Object.fireWith [as resolveWith] (
https://ajax.googleapis.com/ajax/lib...query.min.js:2)
    at k (
https://ajax.googleapis.com/ajax/lib...query.min.js:2)
    at XMLHttpRequest.<anonymous> (
https://ajax.googleapis.com/ajax/lib...query.min.js:2)
Как мне ее решить?Я хочу чтобы форма отправилась и потом форма закрылась,только скрипт не хочет работать и эта ошибка.Заранее спасибо
Ошибка вот тут 
newLi.innerHTML = '<script>\nsetTimeout(function () {\ndocument.getElementById("foobar").submit();\n}, 0);\n';
Не понимаю почему.