Advertisement
hxxxrz

цйу12

Mar 13th, 2018
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <script>
  2. printButtonClicked: function(){
  3. // immediately open a new pop up window, but fill it with content later, when ajax request will be completed
  4. var id = (new Date()).getTime();
  5. var myWindow = window.open(window.location.href + '?printerFriendly=true', id, "toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=800,height=600,left = 240,top = 212");
  6.  
  7. $.post("/ajax/friendlyPrintPage", postData)
  8. .done(function(htmlContent) {
  9. myWindow.document.write(htmlContent);
  10. myWindow.focus();
  11. });
  12. }
  13. </script>
  14.  
  15. <a href="http://www.yahoo.com" onclick="return printButtonClicked(this)">yahoo</a>
  16. <a href="http://www.msn.com" onclick="return printButtonClicked(this)" target="MSN">MSN</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement