0戴尔3130cn标志添加打印图标打印单个博客文章

除了这个博客,我也有一个 博客有关食谱I decided that I wanted a print icon on the main page for each post so that people can print the recipes. Googling provided vari­ous sug­ges­tions, none of which worked. How­ever, I even­tu­ally cobbled togeth­er the fol­low­ing, 这似乎工作...

编辑博客的代码,发现代码

<!-- email post links -->

Above that put the fol­low­ing…

&lt;script&gt;
function printPost(postUrl)
{
doPrint = true;
var pw = window.open(postUrl);
}
if(opener.doPrint == true)
{
window.print();
window.onfocus = function() { window.close(); }
}
&lt;/script&gt;

&lt;a expr:href='&quot;javascript:printPost(&quot; + &quot;&quot;&quot; + data:post.url + &quot;&quot;&quot; +  &quot;);&quot;'&gt;&lt;img src='http://siteresources.worldbank.org/images/Print_plain.gif'/&gt;&lt;/a&gt;

大功告成!

Cred­it in vari­ous parts goes to…
Con­sum­ing Exper­i­ence
Blog­ger Plu­gins
Sharkyso­ft

你怎么看? 请给我们一个评论如下! 如果您想订阅,请使用菜单上的订阅链接右上方. 您还可以通过使用下面的链接社会分享这与你的朋友. 干杯.

发表评论