[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Unable to call Print Dialog in Firefox, Works in IE

Posted on 2012-03-14
Medium Priority
Last Modified: 2012-03-14
I have a jquery ui dialog that appears to client with Printer Friendly content.  The dialog box contains two buttons, 'Print' and 'Cancel'.  The Print button contains the standard javascript command to call the print dialog button.  This function works in IE but not in Firefox.  What needs to be done differently for?

see code:
    //Build function to handle Printable Pages
    function openPrintDialog(divName, iframeID, ajaxUrl, displayTitle, defaultWidth, defaultHeight, openStatus, page, iframeWidth) {
        //this dialog is used to show the printable version of the Client Record
        var $dialog = $('<div id="' + divName + '"></div>')
                .html('<iframe id="' + iframeID + '" style="border: 0px; " src="' + page + '" width="' + iframeWidth + '" height="' + defaultHeight + '"></iframe>')
                    autoOpen: openStatus,
                    title: displayTitle,
                    width: defaultWidth,
                    height: defaultHeight,
                    modal: true,

                    //Define Buttons
                    buttons: {
                        Print: function () {
                            var objFrame = window.frames[iframeID];

                            //Now close dialog
                        Close: function (ev, ui) {
                            clearPrintIframe('#' + iframeID);
                });                     //end of Dialog w/options

    };  //End of openPrintDialog Function
Question by:Robert Treadwell
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

Robert Treadwell earned 0 total points
ID: 37720209
Answered this one my self.  Changed the Print section to determine the browser type and then changing print functionality to fit the browser type.

                        Print: function () {
                            var nav = navigator.appName;
                            if (nav == "Microsoft Internet Explorer") {
                                var objFrame = window.frames[iframeID];
                            } else if (nav == "Netscape") {
                                $('#' + iframeID)[0].focus();
                                $('#' + iframeID)[0].contentWindow.print();

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

649 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