469,274 Members | 1,833 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,274 developers. It's quick & easy.

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 1644
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.