By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,282 Members | 1,538 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,282 IT Pros & Developers. It's quick & easy.

word doc opens by default

P: n/a
ME
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="JavaScript">

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

var isReady = false;
function doSaveAs(){
if (document.execCommand){
if (isReady){document.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="javascript: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/????

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, and not opening automatically when clicked. It's driving me up the wall, hours and hours, and I know I've done this before, a few years ago.

ME


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

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

Subject: onclick event or similar needed

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 think of except renaming/converting files would be appreciated.
no zips zip file convert download me


Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Sun, 5 Sep 2004 22:06:06 -0500, ME <me@mine.com> wrote:
http://www.codefoot.com had this; but can someone give me a clue?

javascript: Invoking The SaveAs Dialog From A Web Page


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.
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.