word doc opens by default

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ME

    #1

    word doc opens by default

    http://www.codefoot.com had this; but can someone give me a clue?

    JavaScript: Invoking The SaveAs Dialog From A Web Page
    Re: damn, word doc opens by default, onclick event or similar needed

    save as save-as prompt download to
    Step 1.: The Script
    -------------------

    Insert the following script in the head of the page:

    <script language="JavaS cript">

    // Source: CodeFoot.com
    // Please leave in this header.

    var isReady = false;
    function doSaveAs(){
    if (document.execC ommand){
    if (isReady){docum ent.execCommand ("SaveAs");}
    }else{
    alert('Feature available only in Internet Exlorer 4.0 and later.');
    }
    }

    </script>

    Step 2.: The Body Tag Interlock
    -------------------------------

    Include the following onload event call in the body tag. This stops
    the script from functioning until the page is fully loaded.

    <body onload="isReady =true">



    Step 3.: The Link
    -----------------

    To call the script from the page and activate the SaveAs dialog,
    insert a link in the page like this:

    <a href="javascrip t:doSaveAs()">
    Click Here To Save This Page
    </a>

    Re: damn, word doc opens by default, onclick event or similar needed

    Subject: ?????HTML SPECIFICATIONS / ONCLICK EVENTS/????

    [color=blue]
    > hi,
    > anyone know where i might find onclick events listed? I need to see all
    > possible onclick events, html preferred and not necessarily javascript.
    >
    > I need links on web page to word files to prompt to save or download,[/color]
    and[color=blue]
    > not opening automatically when clicked. It's driving me up the wall,[/color]
    hours[color=blue]
    > and hours, and I know I've done this before, a few years ago.
    >
    > ME
    >
    >[/color]

    Subject: HTML question (need htm link to save, not open doc files)

    [color=blue]
    > HTML question (need htm link to save, not open doc files)
    >
    > zips give you an option to save or open, but docs just open, slow and hang
    > the system for a minute.
    >
    >
    >
    > mike
    >
    >[/color]


    Subject: onclick event or similar needed

    [color=blue]
    > Hi,
    > links to doc files always open. I need a prompt to save, not to freakin
    > open. href onclick or onload, or something , anything that you might[/color]
    think[color=blue]
    > of except renaming/converting files would be appreciated.
    >[/color]
    no zips zip file convert download[color=blue]
    > me
    >
    >[/color]



  • Michael Winter

    #2
    Re: word doc opens by default

    On Sun, 5 Sep 2004 22:06:06 -0500, ME <me@mine.com> wrote:
    [color=blue]
    > http://www.codefoot.com had this; but can someone give me a clue?
    >
    > JavaScript: Invoking The SaveAs Dialog From A Web Page[/color]

    There is only one way to do this properly: on the server. It involves
    sending the Content-Disposition header to the client. See the FAQ:

    <URL:http://jibbering.com/faq/>

    [snip]

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.

    Comment

    Working...