471,853 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

Save Page As button on the page

Hi,
have a short question.
I want to introduce PrintPage and SavePageAs buttons on the page.
First one is easy:
<input type="button" id="btnPrint" onclick="window.print( )" value="Print"> .
Can not figure out how to implement SavePageAs ...
Anybody can help?

Thanks!
May 7 '07 #1
1 1673
iam_clint
1,208 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. function doSaveAs(){
  2. if (document.execCommand){
  3. document.execCommand("<b style="color:black;background-color:#a0ffff">SaveAs</b>");
  4. } else{
  5. alert('Your browser does not allow execute command, please select file save as.');
  6. }
  7. }
  8.  
this function will only work in internet explorer I believe call it like this
<input type="button" onclick="doSaveAs();" value="Save As">
May 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by David W. Simmonds | last post: by
12 posts views Thread by Daniel Walzenbach | last post: by
5 posts views Thread by C Watson | last post: by
12 posts views Thread by =?Utf-8?B?RnJlZU5FYXN5?= | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.