Visual Basic (1)
New related comments
Number of comments in the last 48 hours
Validating user input in a form
Can I disable the Refresh button in Internet Explorer
Dynamically collapse or expand a section of a web page
Opening a window without a title bar
How can I start two simultaneous downloads with one link?
2 comments. Current rating: (1 votes). Leave comments and/ or rate it.
Question:I need to ensure that a user downloads two files and want to start both downloads once the user has clicked on 'Download now'. I cannot pack both files in one archive. How can I achieve this?
Answer:This is a good application for IFRAMEs. (Or regular FRAMEs). Have one (I)FRAME for each document and write a function that sets each frame's location to one of the downloads.
If you want to go fancy, you can even create those IFRAMEs dynamically on the fly with insertAdjacentHTML and setting their SRC parameter to each file's URL.
Otherwise simply provide the two IFRAMEs somewhere small and not noticable at the bottom of the page and dynamically set their SRC attribute.