Refactor
:my
=>
'code'
Codes
Refactorings
Popular
Best
Submit
Spam
Account
Logout
Login
JavaScript doesn't seem to be activated, expect things to be ugly and sloppy!
Learn How to Create Your Own Programming Language
createyourproglang.com
Recent
Zynga Slingo Trainer v5.12
iTunes Gift Card Generator V3.1 2012
Diablo 3 GOLD Coins FREE
Working PS3 Jailbreak 3.65 And 3.66
ExtaBit Premium Accounts and Cookies
Steam Wallet Hack - Money Adder & Hack v3
Empires & Allies Hack Cheat Trainer v5.4.1
Eve Onnline 60 Days Time Card Generator v2
Xbox Lve Generator v3
Better way to get content via jQuery $.get()
Popular
XBOX POINTS GENERATOR - MICROSOFT POINTS GENERATOR v1.2012
11 may 2012 premium uploading accounts 100% working
Free Microsoft Points
Free Microsoft Points - Microsoft Points Generator - Xbox Live Codes 2012
Car Town Free Blue Points Hack
Free CarTown Blue Points Generator and CarTown Templates
Free Microsoft Points
Simple Days Purger
Sharecash Downloader Bypass Surveys New 05/2012
PAYPAL REMOVE ACCESS LIMITED ACCOUNT 100% Working
Pastable version of
print an image
<pre class='prettyprint' language='javascript'><html> <head> <title>Print Image Only</title> <script> function makepage(src) { // We break the closing script tag in half to prevent // the HTML parser from seeing it as a part of // the *main* page. return "<html>\n" + "<head>\n" + "<title>Temporary Printing Window</title>\n" + "<script>\n" + "function step1() {\n" + " setTimeout('step2()', 10);\n" + "}\n" + "function step2() {\n" + " window.print();\n" + " window.close();\n" + "}\n" + "</scr" + "ipt>\n" + "</head>\n" + "<body onLoad='step1()'>\n" + "<img src='" + src + "'/>\n" + "</body>\n" + "</html>\n"; } function printme(evt) { if (!evt) { // Old IE evt = window.event; } var image = evt.target; if (!image) { // Old IE image = window.event.srcElement; } src = image.src; link = "about:blank"; var pw = window.open(link, "_new"); pw.document.open(); pw.document.write(makepage(src)); pw.document.close(); } </script> </head> <body> <h1>Print Image Only</h1> When you click on the image below, just the image should print. And the temporary window used in the process should go away afterwards, whether you allow the print operation to go ahead or not. <p> <noscript> <b>You have JavaScript turned off.</b> So this won't work. That is to be expected. </noscript> <p> <img src="http://www.boutell.com/boutell/images/fortune.jpg" onClick="printme(event)"/> </body> </html></pre> <a href="http://www.refactormycode.com/codes/197-print-an-image" style="color:#fff" title="As seen on RefactorMyCode.com"><img alt="Small_logo" src="http://www.refactormycode.com/images/small_logo.gif" style="border:0" /></a>