如何通过使用 jquery 单击链接来执行键盘快捷键 CTRL + P
问题描述:
我想打印一个页面,所以我必须点击CTRL + P,所以我想制作一个链接来简化这个过程.任何帮助表示赞赏!
I want to print a page to do so I have to click CTRL + P, so I would like to make a link to ease the process. Any help is appreciated!
答
你不需要模拟 CTRL + P 按键来打印窗口 - 你可以只需在需要时调用 window.print()
.
You don't need to simulate a CTRL + P keypress to print the window - you can just call window.print()
when required instead.