The following javscript code helps you determine if the page you are trying to print has loaded completely. This prevents users from printing partialy loaded pages. This problem occurs when a visitor tries to print a page and a page suitable for printing is generated by the browser.
This is the button that upon click prints the page:
<form name="xform"><input type="button" value="print"
onclick="self.print()"></form>
This is the code that check to see if the page has loaded:
<html>
<head>
<script language="javascript">
var doneloading = false;
function printpage()
{
if(doneloading)
{
window.print();
}
else
{
alert('page is not done loading yet! please wait and try again.')
}
}
function finishloading()
{
doneloading=true;
}
</script>
</head>
<body>
.. ...
<a href="printpage()"><img alt="print page"
src="images/button-image.gif" border="0"></a>
</body>
</html>
... ..
Posted 1 month ago #
You must log in to post.
.net address attributes browsers censored config css dates email validation filter firefox floor functions html ie ie fix image functions images input ip javascript links mail match math min-height min-width netscape opera php preloading print regex script smtp string styles textbox time validation variables visual basic