Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


save page

save page

save page


<a href="" onclick="Javascript: window.print()">Print this page</a>

the above prints the current page.

is there a way to save the current page to my local hard drive?
<a href="" onclick="Javascript: window.Save????()">Save this page</a>




RE: save page


i have tried "execCommand".
but i needed it to work with other browsers too.

thanks a lot for your reply...


RE: save page

thanks ...


RE: save page

This is how you do it cross-browser. On the moz-based block, you might need to know a bit of xul to understand in order to script; but operational-wise it does not need any knowledge of it. It just differs from ie now by asking explicitly the xpconnect privilege from the user. The user can deny it, sure. It can be granted on one-time-basis. (Do not click on the remember checkbox and you're remaining safe.) The reason is that by default that privilege is denied (for good reason, and I am not suggesting to switch it permanently to allow.)

The demo is no-nonsense free from artificial irrelevance and well-focused.

<script type="text/javascript">
function go_saveas() {
    if (!!window.ActiveXObject) {
    } else if (!!window.netscape) {
        var r=document.createRange();
        var oscript=r.createContextualFragment('<script id="scriptid" type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"><\/script>');
        try {
        } catch (e) {
            //no further notice as user explicitly denied the privilege
        } finally {
            var oscript=document.getElementById("scriptid");    //re-defined
<a href="#" onclick="go_saveas();return false">save the document</a><br />

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close