Javascript-форум (https://javascript.ru/forum/)
-   Events/DOM/Window (https://javascript.ru/forum/events/)
-   -   Удаление текста из html документа (https://javascript.ru/forum/events/4872-udalenie-teksta-iz-html-dokumenta.html)

magavnuk 02.09.2009 19:55

<html>
<head>
<script type="text/javascript">
function atoprint(aId)
 {
    var atext ="<html><body>alex</body></html>" ;//document.getElementById(aId).innerHTML;
    var captext = window.document.title;
    var alink = window.document.location;
    var prwin = open('');
 
   //if (alink.indexOf("pubID") !=-1)
  // {
    prwin.document.open();
    prwin.document.writeln('<html><head><title>Версия для печати<\/title><\/head><body text="#000000" bgcolor="#FFFFFF"><div onselectstart="return false;" oncopy="return false;">');
    prwin.document.writeln('<div style="margin-bottom:5px;"><a href="javascript://" onclick="window.print();">Печать<\/a> • <a href="javascript://" onclick="window.close();">Закрыть окно<\/a><\/div><hr>');
    prwin.document.writeln('<h1>'+captext+'<\/h1>');
    prwin.document.writeln(atext);
    prwin.document.writeln('<hr><div style="font-size:8pt;margin-top:20px;">© Портал SzenProgs.ru<\/div>');
    prwin.document.writeln('<div style="font-size:8pt;">Страница материала: '+alink+'<\/div>'); 
    prwin.document.writeln('<div style="margin-top:5px;"><a href="javascript://" onclick="window.print();">Печать<\/a> • <a href="javascript://" onclick="window.close();">Закрыть окно<\/a><\/div>');
    prwin.document.writeln('<\/div><\/body><\/html>'); 
    // }
}
</script>
</head>



<body>
<input type="text" id="aId"/>
<button onclick="atoprint('aId')" value="click"  ></button>
</body>
</html>

magavnuk 02.09.2009 19:57

вроде все правелно ты сделал!!!

exru 26.07.2012 14:55

kj[


Часовой пояс GMT +3, время: 06:39.