dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
550
share rss forum feed


cowboyro
Premium
join:2000-10-11
Shelton, CT
Reviews:
·AT&T U-Verse

2 edits
reply to franzcatch

Re: Opening a file download dialog from a JavaScript function.

in the HEAD section:
<script type="text/javascipt">
function startDownload()
{
var url='http://server/folder/file.ext';  
window.open(url,'Download');
}
</script>
 
in BODY
<script type="text/javascipt">
setTimeout("startDownload()",5000); //starts download after 5 seconds
</script>
 

or if you have just 1 download location you can combine the 2 in the body:

<script type="text/javascipt">
setTimeout("window.open('http://server/folder/file.ext','Download')",5000); 
</script>
 

Edit: I wouldn't worry so much about the 0.01% that are paranoid and turn off javascript... But *do* provide a link in case a popup blocker kills the download.