Jump to content

Print page


george

Recommended Posts

Man, don’t tell me there are no gremlins in these machines!I used the sample code exactly as given for the DOM print command “window.print()”It worked wonderfully.I put it in my site, and it demands semi-colons, Ok, I put in the semi-colons. The error is gone, but now it won’t work . An alert box pops up that says “Print”. Why! Why does that happen? There is no Alert box code in the entire site. How can I get my page to print? Ok, I know you want to see the code, so here it is:

<a href="java script:window.print()"><img src="images/print_icon.gif" width="18" height="18" />Print this page</a></span>

or

<script type="text/javascript">function printpage() {	window.print();	}</script>

<a href="#"><img src="images/print_icon.gif" width="18" height="18" onclick="printpage();" />Print this page</a></span>

Link to comment
Share on other sites

The code that works and the code that does not are both being viewed on a Windows IE 7

<!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"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><link type="text/css" href="style-1.css" rel="stylesheet"  /><script type="text/javascript" src="jscript.js"></script><script type="text/javascript">function printpage() {	window.print();	}</script><style type="text/css">	#footer { 	position:absolute;				bottom:-1395px;				left:295px;			 }</style></head><body><span id="menu_o" onmouseover="highlight(this.id);" onmouseout="dehighlight(this.id)" onclick="window.open('index.html','_self');" >Home</span><span id="menu_a" onmouseover="highlight(this.id);" onmouseout="dehighlight(this.id)" onclick="window.open('menu_a.html','_self');" >About Us</span><span id="menu_b" onmouseover="highlight(this.id);" onmouseout="dehighlight(this.id)" onclick="window.open('menu_b.html','_self');" >Join DCNA</span><span id="menu_c" onmouseover="highlight(this.id);" onmouseout="dehighlight(this.id)" onclick="window.open('menu_c.html','_self');" >Collective Bargaining Units</span><span id="menu_d" onmouseover="highlight(this.id);" onmouseout="dehighlight(this.id)" onclick="window.open('menu_d.html','_self');" >Continuing Education</span><span id="menu_e" onmouseover="highlight(this.id);" onmouseout="dehighlight(this.id)" onclick="window.open('menu_e.html','_self');" >Nursing Practice</span><span id="menu_f" onmouseover="highlight(this.id);" onmouseout="dehighlight(this.id)" onclick="window.open('menu_f.html','_self');" >DC Legislation</span><span id="menu_g" onmouseover="highlight(this.id);" onmouseout="dehighlight(this.id)" onclick="window.open('menu_g.html','_self');" >News and Upcoming Events</span><span id="menu_h" onmouseover="highlight(this.id);" onmouseout="dehighlight(this.id)" onclick="window.open('menu_e.html','_self');" >Contact Us</span><span id="menu_i" onmouseover="highlight(this.id);" onmouseout="dehighlight(this.id)" onclick="window.open('menu_i.html','_self');" >Links</span><span id="MyThreeIcons"><a href="java script:window.external.AddFavorite(location.href);"><img src="images/bookmark_icon.gif" width="18" height="18" />Bookmark this page</a><a href="mailto:info@dcna.org"><img src="images/email_icon.gif" width="18" height="18" />Email this page</a><a href="java script:window.print(this.document)"><img src="images/print_icon.gif" width="18" height="18" />Print this page</a></span><span id="cage"><ol><li><strong>Why Should I Join DCNA</strong></li><p>Membership in DCNA is an investment in your financial and professional health. Membership benefits you through:<p><ul><li>A competitive edge in the marketplace with salary and benefit guarantees</li><li>Access to expert assistance for practice and workplace problems</li><li>Achieving professional goals with the support of colleagues in unity</li><li>Keeping current with new developments</li><li>Networking opportunities</li><li>Member discounts on products, programs and services</li></ul><p>Check your State Nurses Association (SNA) Member Guide to find out about the valuable products, programs, and services for which members are eligible due to the buying power of 200,000 SNA members.</p><p>Power is the watchword for DCNA membership.  When nurses join DCNA, employers get the message.  Hospitals know they are dealing with nurses who are committed to their goals, and unified in their vision.  That translates into strength at the negotiating table and influence in the legislature.</p><p>Everyone benefits from your membership in DCNA— you as an employed registered nurse, your family, your community, and the nursing profession. </p><li><strong>How Do I Become a Member?</strong></li><p>Fill out an application and send it in!  Any registered nurse can join and participate in a variety of DCNA activities. The “non-collective bargaining” application is for any nurse who is NOT represented by a DCNA union at work.<p><p>DCNA union nurses have access to payroll deduction by filling out the “collective bargaining” application AND a dues authorization form. DCNA union nurses can participate in all DCNA activities.</p><p>For more information, please contact DCNA Manager, Finance and Administration at vscales@dcna.org or by phone at (202) 244-2705.</p><li><strong>Forms (PDF)</strong></li><ul><li>Membership Application for Collective Bargaining/Payroll Authorization Form </li><li>Membership for Non-Collective Bargaining </li><br />(For employed full-time or part-time AND covered by a collective bargaining agreement, unemployed full-time students and RN 62 years of age or older)<li>Email for membership applications</li></ul><br /><a href='mailto:info@dcna.org'>info@dcna.org</a><p>Collective Bargaining Units</p></ol></span><span id="footer">	<center>5100 Wisconsin Ave., N.W., Suite 306, Washington DC NW 20016</center>	<center>202 244 2705 Fax: 202 362 8285 email: <a href="mailto:info@dcna.org">info@dcna.org</a></center></span></body></html>

Link to comment
Share on other sites

what is in jscript.js? Is this the source of the print alertbox?
No. There is no call to alert anywhere on the web site. Honest. But here is the js just so you can check.
Opps . . . guess what I found. a function called print() that called an alert!

The bad code is gone, the program works, I feel like a million bucks. Thank you for your patience, guiding me through until I found my own blunder.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...