javascript 打印
Oftentimes a novice web user wont think to do something unless they are presented with the option to do so. I've found this to be true of many of the websites I make. I've added "email to a friend" functionality to customer websites and traffic seems to increase (albeit a fraction, but every bit helps).
经常,新手Web用户不会考虑做某事,除非向他们提供这样做的选项。 我发现这对我创建的许多网站都是正确的。 我已经向客户网站添加了“发送给朋友的电子邮件”功能,并且访问量似乎有所增加(尽管有所增加,但一点点都有帮助)。
Some websites are helped by adding a JavaScript "print" link. If you have a page with a coupon, for example, or a page that acts as a promotional piece, I recommend adding a "print" link. Users will get your subtle message and that could mean increased business / traffic.
通过添加JavaScript“打印”链接可以帮助某些网站。 例如,如果您有一个带有优惠券的页面或一个用作促销品的页面,则建议添加“打印”链接。 用户会收到您的微妙信息,这可能意味着业务/流量的增加。
代码 (The Code)
Some quick JavaScript in the "href" attribute of the anchor will accomplish this goal.
锚点的“ href”属性中的一些快速JavaScript将实现此目标。
<a href="javascript:window.print();">Print</a>
Be sure not to put the JavaScript in the onClick attribute of the anchor -- not everyone clicks a link.
确保不要将JavaScript放在锚点的onClick属性中-并非每个人都单击链接。
javascript 打印