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

Posted on 2012-08-24
Last Modified: 2012-08-27
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/';

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.

Question by:HyperBPP
    LVL 51

    Accepted Solution

    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');
        return false; //this is critical to stop the click event which will trigger a normal file download!

    Open in new window

    LVL 6

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    Title # Comments Views Activity
    network + 7 57
    Gravity Forms  submission tracking. 3 20
    How can I see the value of the "object" 10 18
    jquery not selector 4 6
    Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question ( on how to make a page show some balloons animate up a page…
    Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now