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

Closing the pop up and downloading a file simultaneously

P: n/a
Hello All,

Using Javascript and using one click, I have to close the window(pop
up) and start the download of a file simultaneously.

There will be a hyperlink in a pop up window as "Click here to start
the download". When the user clicks on it, this pop up window should
close and the file(which is behind the screen) will start to download.

Can someone please tell me how to do this or point me to the right
website where I can find an answer to this question?

Thanks
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
in the main window:

function startDownload() {
do whatever e.g document.location = filename etc...
}

in the pop-up window:

(this is the onlick event for the "click here to start....")

function startDownload() {
window.opener.startDownload();
self.close()
}

"Anitha" <an*****@yahoo.com> wrote in message
news:bb**************************@posting.google.c om...
Hello All,

Using Javascript and using one click, I have to close the window(pop
up) and start the download of a file simultaneously.

There will be a hyperlink in a pop up window as "Click here to start
the download". When the user clicks on it, this pop up window should
close and the file(which is behind the screen) will start to download.

Can someone please tell me how to do this or point me to the right
website where I can find an answer to this question?

Thanks

Jul 23 '05 #2

P: n/a
Thanks, your idea works.

But I want to download .ppt files in IE and Netscape. For .ppt files,
the file opens but immediately goes to the slideshow mode and so the
user can only view and not download the file.

How do I make them save the .ppt file?

OR

Now what I want to do is, open the .ppt in a new window(as opposed to
open it in the main window) and somehow make them download or open the
file not in slideshow mode.

Can you please help me with this?

Thanks

"Dominique" <ni****@webadstudio.com> wrote in message news:<c7**********@ctb-nnrp2.saix.net>...
in the main window:

function startDownload() {
do whatever e.g document.location = filename etc...
}

in the pop-up window:

(this is the onlick event for the "click here to start....")

function startDownload() {
window.opener.startDownload();
self.close()
}

"Anitha" <an*****@yahoo.com> wrote in message
news:bb**************************@posting.google.c om...
Hello All,

Using Javascript and using one click, I have to close the window(pop
up) and start the download of a file simultaneously.

There will be a hyperlink in a pop up window as "Click here to start
the download". When the user clicks on it, this pop up window should
close and the file(which is behind the screen) will start to download.

Can someone please tell me how to do this or point me to the right
website where I can find an answer to this question?

Thanks

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.