Can we make Print button without JavaScript?

落爺英雄遲暮 提交于 2019-12-31 03:54:12

问题


Can we make Print button without JavaScript? to open browser print window.


回答1:


HTML has no built-in "print" action for an anchor tag or input button (or anything else), so JavaScript is your way. You could also include instructions for your users on how to print using File->Print or the other various alternatives.




回答2:


Althought as @Pablo says there is no print functionality that can be used without javascript, here is something that will make it a little nicer just in case there was a user that had javascript disabled:

http://www.456bereastreet.com/archive/200709/how_to_create_an_unobtrusive_print_this_page_link_with_javascript/




回答3:


You could do it with a Java applet but javascript is simpler and cleaner.




回答4:


Not with straight HTML. You could do it with Java, ActiveX, etc, but those are even more to add than JavaScript.



来源:https://stackoverflow.com/questions/1720013/can-we-make-print-button-without-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!