开发者

Save Page / Print Page buttons for the page that iframe src is linking to

开发者 https://www.devze.com 2023-03-10 10:51 出处:网络
Assuming I have outerpage.html <html> <head>开发者_如何转开发 </head> <body>

Assuming I have outerpage.html

<html>
<head>开发者_如何转开发
</head>
<body>
    <input type="button" id="printPage" name="printPage" />
    <input type="button" id="savePage" name="savePage" />
    <iframe src="someOtherPage.html"></iframe>
</body>
</html>

How can I use Javascript to save and print someOtherPage.html when the respective buttons are clicked?


Use the window.print() method.

Also refer to the following link for similar question and answer.

How do I print an IFrame from javascript in Safari/Chrome

0

精彩评论

暂无评论...
验证码 换一张
取 消