hatton_james
11-06-2002, 05:57 PM
Thanks to cg9com for answering my last question. I have wrote a function which prints the page using window.print(). The function is called when the page loads. And works fine, but I want to add a check to see if the users browser supports the window.print() feature. Here is the code I have but it doesn't work:
<head>
<script language="javascript" type="text/javascript">
function jprint() {
if (window.print != null) {
window.print()
window.close() }
else {
alert('Sorry, your browser does not support this feature. To print
this page, select Print from the File menu.')
window.close() }
}
</script>
</head>
<body onload="jprint()">
Can anyone tell me what the problem is?
<head>
<script language="javascript" type="text/javascript">
function jprint() {
if (window.print != null) {
window.print()
window.close() }
else {
alert('Sorry, your browser does not support this feature. To print
this page, select Print from the File menu.')
window.close() }
}
</script>
</head>
<body onload="jprint()">
Can anyone tell me what the problem is?