I want to create several versions of pages for printing from one page. I am going to do it this way: by placing several buttons on the original page and clicking one button, you will see a new window with the same html as its parent window, but with some changes (for example, set the display attribute of some DIV to none).
Can javascript be used for this?
You can pass an additional parameter to the current page URL and open it in a new window, for example:
window.open(document.location.href + "?print=true");
URL JavaScript CSS, .
: CSS , ? , :
window.print();
HEAD:
<link rel="stylesheet" href="yourcssfile.css" media="print" />
CSS , , . . CSS.
, javascript, :
window.open('myPage.html') getElementById('<someid>').style.display = none
CSS, CSS div hidings whatnot. , . , .
, , :
<link rel="stylesheet" type="text/css" media="print" href="myPrintStyles.css"/>
Source: https://habr.com/ru/post/1738820/More articles:does clipsToBounds = YES reduce memory? - iphoneПолучить относительный путь к связанному ресурсу в С# - c#Get a license file from a folder in a C # project - c #What is a framework? How Zend Framework for PHP - phpHow to change an object's class to a subclass of its current class in C ++? - c ++complex SQL when joining - sqlGrayscale image with color spotlight in JavaFX - javafxreturn statement created by mysqli_stmt_bind_param - phpКак получить функциональность Autocomplete без контроля - .netBuild Warning. Disabling auto-resolution previews is not supported on iPhone OS versions up to 3.0 - iphoneAll Articles