navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

print page - not printing

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> print page - not printing
Page: [1]
 
levins

 

Posts: 272
Joined: 12/12/2001
From: Hartland WI USA
Status: offline

 
print page - not printing - 2/11/2008 14:00:12   
I have a page that I want people to be able to to print. It is not working

I put this script and inserted in the head section

<script language="JavaScript">
var gAutoPrint = true; // Tells whether to automatically call the print function

function printSpecial()
{
if (document.getElementById != null)
{
var html = '<HTML>\n<HEAD>\n';

if (document.getElementsByTagName != null)
{
var headTags = document.getElementsByTagName("head");
if (headTags.length > 0)
html += headTags[0].innerHTML;
}

html += '\n</HE>\n<BODY>\n';

var printReadyElem = document.getElementById("printReady");

if (printReadyElem != null)
{
html += printReadyElem.innerHTML;
}
else
{
alert("Could not find the printReady function");
return;
}

html += '\n</BO>\n</HT>';

var printWin = window.open("","printSpecial");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("The print ready feature is only available if you are using an browser.
Please update your browswer.");
}
}

</script>


And I put this in the body

<div id="printReady">
The text I want to print is inside divide.
</div>

Why is the page not printing?
Larry M.

 

Posts: 2834
Joined: 2/20/2003
From: Greenville, South Carolina, USA
Status: offline

 
RE: print page - not printing - 2/11/2008 14:10:43   
Assuming you want visitors to click on a printer icon with an embedded hyperlink, use:

javascript:window.print() for Location

Make sure Target Frame = Same Frame



_____________________________

Larry M.

Reality is the leading cause of stress among those few in touch with it

(in reply to levins)
levins

 

Posts: 272
Joined: 12/12/2001
From: Hartland WI USA
Status: offline

 
RE: print page - not printing - 2/11/2008 14:35:51   
It's working Thanks!

(in reply to Larry M.)
levins

 

Posts: 272
Joined: 12/12/2001
From: Hartland WI USA
Status: offline

 
RE: print page - not printing - 2/11/2008 15:16:47   
It works but an error message is printed on the page. (the output page) The error is [an error occurred while processing this directive]

(in reply to levins)
Page:   [1]

All Forums >> Web Development >> General Web Development >> print page - not printing
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts