Forum Moderators: open

Message Too Old, No Replies

How to show automatic print message and open in the same window ?

         

toplisek

6:10 pm on Dec 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



How to show automatic print message and open in the same window ?
I would like to make Javascript system

It opens message to print and it shows name of file to print with the same name but prepared to print correctly (optimised to be printed page).
How to achieve this?

There should be link like: Printer friendly page

toplisek

7:51 pm on Dec 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



To be more specific about issue:
1. There should be link like: Printer friendly page
2. Flag for whether or not to automatically call the print function
3. Possible Alert notice as following:
Could not find the printReady section in the HTML
4. Possible Alert notice as following:
Sorry, the print ready feature is only available in modern browsers.
5. Show automatic print message and open in the same window.
6. It opens message to print and it shows name of file to print with the same name but prepared to print correctly (optimised to be printed page).

Need help.

lavazza

8:28 pm on Dec 14, 2008 (gmt 0)

10+ Year Member



I suggest that, rather than duplicating your content and then figuring out a way to control the behaviour via a script, you investigate the (much simpler) method of employing a media="print" stylesheet [webmasterworld.com]

HTML is for content
CSS is for presentation
Javascript is for behaviour

:)

toplisek

10:45 am on Dec 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi,
I have created file to test printing link.

Can you please check what is wrong and can be better?
See my code and I would like to use 'Server Side Includes (SSI)' which is is a simple server-side scripting languageand including the contents of one file into another one dynamically when the latter is served by a web server.
(SSI is primarily used to "paste" the contents of one or more files into another.).

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
<link rel="stylesheet" type="text/css" href="test.css" media="screen" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
<style type="text/css">
/*<![CDATA[*/
body {
font-family: Verdana,Arial;
font-size:10pt;
}
h2 {
font-family: Arial, helvetica, sans-serif;
font-size: 13pt;
font-weight: normal;
color: #333333;
line-height: 13pt;
}
/*]]>*/
</style>

<style type="text/css">
/*<![CDATA[*/
/* this is styles_printing1.css
.h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14pt;
color: #FF9900;
font-weight: bold;
}
*/
/*]]>*/
</style>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
document.getElementsByTagName('tbody')[0].style='styles_printing1.css';
/*]]>*/
</script>
</head>

<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<!-- Start tBody css and content -->
<tbody><tr>
<td>
<h1>My Sample printing page</h1>
</td>
<td align="right" valign="top">
<a href="...">Print&nbsp;this&nbsp;page</a>

</td>
</tr>
</tbody><!-- End tBody css and content --> </table>
<!--Start SSI -->
<!-- Body css and content -->
<h2>How to make printing page?</h2>
</body>

</html>

toplisek

8:04 am on Dec 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I would like to make:
1. link with print button (see Print&nbsp;this&nbsp;page)
2. use h1 specification within tbody (predefined content) for all pages.
(see <!-- Start tBody css and content --)
3. make all pages and its content included in body
<!-- Body css and content -->
4. using SSI
(see <!--Start SSI -->)

[edited by: eelixduppy at 8:41 pm (utc) on Dec. 17, 2008]
[edit reason] disabled smileys [/edit]