There is a page with some entries and a check button for each entry. After ticking and clicking on the button, a new page opens, consisting only of the marked entries, which can be saved: RMB - Save as - page.html. How can I make it so that when you click on a button, a new page with marked entries is automatically saved in Page.html?
function make_win(mode,par,waiting){ cmd_str=new Array(); cmd_str[7]= new Array('Печать_записей',cgi+'?I21DBN='+par[0]+'_PRINT&P21DBN='+par[0]+'&S21FMT='+par[1]+'&S21CNR=555&S21COLORTERMS=0&C21COM=S&S21SRW='+par[2]+'&S21ALL='+par[3]+'&FT_PREFIX='+par[6]+'&SAME_SEARCH='+par[4]+'&FT_REQUEST='+par[5]+'&FT_DISTANCE='+par[7]+'&FT_PARAMS='+par[8]+'&FT_NEAR_MFN'+par[9]); x=screen.width-50; y=screen.height-50; cx=screen.width/2-(x/2); cy=screen.height/2-(y/2); adr=(waiting) ? '' : cmd_str[mode][1]; var load_window = window.open(adr,cmd_str[mode][3],cmd_str[mode][4]+',width='+x+',height='+y+',top='+cy+',left='+cx+',resizable=yes,scrollbars=yes'); load_window.focus(); load_window.onload = function() { var html = load_window.document.documentElement.innerHTML; var blob = new Blob([html], {type: "text/html;charset=utf-8"}); window.saveAs(blob, 'print.html'); }; if (load_window == null) { alert('Отключите блокировку всплывающих окон в своём браузере! Всплывающие окна необходимы для корректной работы сайта!'); return; }