Microsoft Edge Browser and Printing RRS feed

  • Question

  • Hello,

    I have a printUrl javascript/jquery function that loads a print friendly version of my web page into an iFrame and prints it.  It seems to work in Chrome, Firefox, and IE but I can't get it to work in Microsoft Edge browser.  The print dialog comes up but with the message "Nothing sent to print" in red.  Any help would be appreciated.  Function below:

     function printUrl(url) {
      $('body').append('<iframe width="1" height="1" id="printFrame" style="display: none; @media print { display: block; }"/>');
      $('#printFrame').attr('src', url);
      $('#printFrame').load(function() {
      var ua = window.navigator.userAgent;
      var msie = ua.indexOf("Trident");  // detect if IE

      if (msie > 0)   {

      var target = document.getElementById('printFrame');
      try {
      target.contentWindow.document.execCommand('print', false, null);
      } catch(e) {
      else {
    // this code executes for Edge printing as well as Chrome, Firefox
      var frame = document.getElementById('printFrame');
      if (!frame) {
      $.alert("Error: Can't find printing frame.");
      frame = frame.contentWindow;
      setTimeout(function(){$('#printFrame').remove()}, 500);

    Sunday, August 23, 2015 2:28 AM


  • Hi Jimmy,

    Regarding scripting related issue, I think we'd better seek help at the Microsoft Edge Dev forum:


    Thank you for your understanding and support.


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Michael_LS Tuesday, September 1, 2015 6:14 AM
    • Marked as answer by Deason Wu Thursday, September 3, 2015 8:03 AM
    Monday, August 24, 2015 10:56 AM