onload=window.open problem

H

hol

I have this problem
I want to automatically download a word document as long as a page has been
loaded.
I used the following code

<body onload=window.open('http://www.mydomain.com/document.doc');return
true;>

but it doesn't seem to work.

Is there a way to open the word document, or even better activate the Save
As dialog?

Thanks beforehand

Mark
 
A

Adrienne Boswell

I have this problem
I want to automatically download a word document as long as a page has
been loaded.
I used the following code

<body onload=window.open('http://www.mydomain.com/document.doc');return
true;>

but it doesn't seem to work.

Is there a way to open the word document, or even better activate the
Save As dialog?

Thanks beforehand

Mark

I would be very unhappy if I went to a web site and it tried to open a Word
document, or tried to download something to me without my permission.

You also have to realise that not everyone _has_ Word.

Better:
<a href="document.doc" type="application/ms-word" title="Word Document XXX
kb">Document (xxx kb) MS Word</a>
 
T

Travis Newbury

hol said:
Is there a way to open the word document, or even better activate the Save
As dialog?

Make it a link? The user decides how (if) a Word document can be
opened. For example in "MY" IE, it just opens. In my wifes it has the
dialog box.
 
R

RvT_PE

Hi Travis,

What Adrienne is trying to say is that many people would find it
suspicious when entering a website with an onload Word document.

Anyway, if a document type is not being recognised, then it will open a
dialog box, but if you subsequently give it permission to always open
it with Word, then the next time such dialog box will not appear. The
latter you have probably done and your wife not, hence the difference.
 
T

Travis Newbury

RvT_PE said:
What Adrienne is trying to say is that many people would find it
suspicious when entering a website with an onload Word document.
Anyway, if a document type is not being recognised, then it will open a
dialog box, but if you subsequently give it permission to always open
it with Word, then the next time such dialog box will not appear. The
latter you have probably done and your wife not, hence the difference.

I know the difference, I was pointing out we chose differently.
 
H

hol

Thanks for all your responce.

I did try RvT_PE's suggestion and it was actually my very first try. For
some reason, it didn't work. It works with JPGs, Gifs etc but not word
documents.

Now as far as Adrienne't reply, I understand what you are saying, but there
is nothing suspicious behind this method. The site is being built in Flash
and when the user clicks a certain button it loads the HTML file that opens
the word document. So the user decides whether or not to open it.

Thank you all

Mark
 
J

Jonathan N. Little

hol said:
Thanks for all your responce.

I did try RvT_PE's suggestion and it was actually my very first try. For
some reason, it didn't work. It works with JPGs, Gifs etc but not word
documents.

Now as far as Adrienne't reply, I understand what you are saying, but there
is nothing suspicious behind this method. The site is being built in Flash
and when the user clicks a certain button it loads the HTML file that opens
the word document. So the user decides whether or not to open it.

Whether or not the user's browser will 'open' a Word document or gives a
'Save as' dialog depends on, the user's OS, the user's browser, the
user's has the application 'Word' and what the user's default handling
settings are for Word documents. The key work here is 'user' not your
coding, in fact using your JavaScript method of creating a popup window
linked to the original document's onload event in a misguided attempt to
'force' the document on your visitor's will not work with my Firefox
that will block the popup!

This is just a bad idea on many levels!

1. Word documents like many high-level document formats can have
embedded scripting code that has been frequently use as worm delivery
tools, so there is a security issue involved here and this type of file
should never be 'automatically' loaded!

2. Yes Billy does own most of the world but not ALL of it yet, Word is a
proprietary document, so again should never be 'automatically' loaded!

3. Word documents because of their formatting, scripting and proprietary
format a generally larger (most time many-fold) then plain text or html
counter parts and are not optimal for general web delivery especially if
'automatically' loaded! Not everyone has broadband.

4. Lastly it is just bad etiquette akin to a tele-marketer's call at
diner-time. Be polite use a regular link with the file description and
file size noted

<a href="pricelist.doc">Our Price List in MS Word200 format (1.2 MB)</a>
or in <a href="pricelist.txt">Our Price List in plain text (10 KB) </a>
 
H

hol

Hi Jonathan, thanks for the comments,

The problem is that my customer wants the site visitors to be able to
download his CV as a word file. This doesn't happen automatically but only
when a user clicks the appropriate button on the main Flash site. This
button opens an html page that loads the word document. As you can see I
have to go through this procedure.

Take care,

Mark
 
A

Adrienne Boswell

Hi Jonathan, thanks for the comments,

The problem is that my customer wants the site visitors to be able to
download his CV as a word file. This doesn't happen automatically but
only when a user clicks the appropriate button on the main Flash site.
This button opens an html page that loads the word document. As you can
see I have to go through this procedure.

Tell your customer politely to stop wanting that. Mention all the reasons
others have mentioned. Always give the user (site visitor) a choice.
 
J

Jonathan N. Little

hol said:
Hi Jonathan, thanks for the comments,

The problem is that my customer wants the site visitors to be able to
download his CV as a word file. This doesn't happen automatically but only
when a user clicks the appropriate button on the main Flash site. This
button opens an html page that loads the word document. As you can see I
have to go through this procedure.

Why? In flash when you link a 'button' symbol to a URL is analogous
adding a href to a A element, right? What's the action script getURL(),
( been a while! ) and link it to the Word doc direcly so the browser
will treat as it would with a direct HTML link

<a href="pricelist.doc">Our Price List in MS Word200 format (1.2 MB)</a>

No need for external pages with auto popup windows,

OR

In the Flash have the button link to a download HTML page with your links

button.getURL('mydownloadpage.html')

and the mydownloadpage.html has plain links to docs as above.
<a href="pricelist.doc">Our Price List in MS Word200 format (1.2 MB)</a>
 
A

Alan J. Flavell

The problem is that my customer wants the site visitors to be able to
download his CV as a word file.

Then offer a straightforward link to the wretched thing from the web
page (with a helpful note saying what format it's in), and leave the
visitors to do whatever they do with such content.
This doesn't happen automatically

We certainly hope not!
but only when a user clicks the appropriate button on the main Flash
site.

Eh? Have you totally lost the concept of "web site"?
This button opens an html page

Why aren't we on an HTML page to start with? This is getting
increasingly silly.
that loads the word document.

HTML is structured markup, it doesn't "load" anything: include a link
to the wretched document: make sure that your server knows the correct
content-type to send it out with, so that any www-compatible browser
can handle it, leaving the "operating system component that thinks
it's a web browser" to do its own thing as usual.

It's all very straightforward for the user, just so long as you don't
keep re-inventing perverse ways of doing things that the web has been
doing without fuss since its early days.
As you can see I have to go through this procedure.

As we can see, you don't know how to use Usenet either.

[upside-down quotage snipped.]
 
J

Jose

The problem is that my customer wants the site visitors to be able to
download his CV as a word file. This doesn't happen automatically but only
when a user clicks the appropriate button on the main Flash site.

First problem is "main Flash site". If this means that the home page is
flash, you have a serious problem with your client.

Jose
 
R

Richard Sexton

Tell your customer politely to stop wanting that.

Hahahahahaha.

I've been doing this since 1993 and lemme count the times THAT'S worked.

Um, zero.
Always give the user (site visitor) a choice.

That works. Do it and don't bother to mention it. Tell them
"some poeple have macs and can't read it so I did this for free
for you".

What you usually find in the person knows 8 people and they
all have word and they think the entire interweb runs on word
and there is no talking them out of it because you're a dumb
techie and he knows his target market. The latter half of
this statement is actually often times true.
 
T

Travis Newbury

Adrienne said:
Tell your customer politely to stop wanting that. Mention all the reasons
others have mentioned. Always give the user (site visitor) a choice.

BUT be prepared to have the customer to go hire someone else that will
give him/her exactly what they want.
 
H

hol

? "Travis Newbury said:
BUT be prepared to have the customer to go hire someone else that will
give him/her exactly what they want.

Couldn't agree more Travis. Looks like you've been in this business.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top