Using javascript to make a pop-up dialog when page loads

I'm using a web application (using ColdFusion 9) to create  an excel file to give to the user to download.  When the page reloads the following is run

window.location.href = '#application.settings.absoluteURL#modules/#url.name#/excel/#fileName#';

This exectedly creates a dialog where the user can "save-as" the file.  However, this makes javascript on the page break (including some jquery items).  Is there an alternative javascript call to prompt a user with "save-as" dialog WHEN th epage loads.  Would prefer to not have to have them press a link.

Thanks!
LVL 6
HyperBPPAsked:
Who is Participating?
 
_agx_Commented:
so the user clicks a link and the page reloads?  since you're already using jquery, what about triggering the download from the initial link? I haven't used it, but here's one example using the jqueryfiledownload plugin



//
//With jquery.fileDownload.js
//bare-bones stock setup
//
$(document).on("click", "a.fileDownloadStock", function () {
    var linkHref = $(this).attr('href');
    $.fileDownload(linkHref);
    return false; //this is critical to stop the click event which will trigger a normal file download!
});

Open in new window

0
 
HyperBPPAuthor Commented:
Perfect!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.