title: Open image to print in new window using jQuery
body: <p>I have been trying to get this seemingly simple jQuery to work. The plan is to have an external image, which is a smaller version of a large promotional landing page, open in a new window with a print dialog and then close after printing (or canceling). This is the closest I can get it to work (<a href="https://jsfiddle.net/paulmz/1r0nxknu/1/" rel="nofollow">jsfiddle</a>):</p>
  
  <pre><code>$('#printBtn').click(function() {
      var couponWindow=window.open('','couponWindow','width=580,height=710');
      couponWindow.focus();
      couponWindow.print();
      couponWindow.close();
  });
  </code></pre>
  
  <p>I have tried numerous attempts and variations to open the image into the new window including:</p>
  
  <pre><code>var couponWindow=window.open(this.href('http://ecommerce.maurices.com/str/pzTesting/mysteryOffer/coupon.gif'),'couponWindow','width=580,height=710');
  </code></pre>
  
  <p>and</p>
  
  <pre><code>var URL = $.myURL("index", $(this).attr('http://ecommerce.maurices.com/str/pzTesting/mysteryOffer/coupon.gif'));
      window.open(URL,'couponWindow','width=580,height=710');
  </code></pre>
  
  <p>All of my attempts to add the image to the window either produces no window, the window opens and closes immediately, or the window opens with the image but doesn't show the print dialog. I have the "coupon" <a href="http://ecommerce.maurices.com/str/pzTesting/mysteryOffer/coupon.gif" rel="nofollow">image hosted externally</a> and have also tried with a <a href="http://ecommerce.maurices.com/str/pzTesting/mysteryOffer/coupon.html" rel="nofollow">basic HTML file</a> with the image wrapped in a div. What am I missing?</p>