通过js实现弹出窗口进行打印

function rundiff()
    {
       var aa=document.getElementById("hidvlaue").value;
       if(aa =="1")
       {
         p();
       }
       else
       {
         retUrl();
       }
    }
    function p()
    {
     var p1=document.getElementById("d1").style.display="none";
     window.print();
    }
    function retUrl()
    {
      window.open('../RoleAndPwoer/UserDetail.aspx?SID=1','','toolbar=0,menubar=0,location=0,status=0,left='+(window.screen.width-800)/2+',top='+(window.screen.height-600)/2+',height=600px,width=800px,scrollbars=yes')
    }

原文地址:https://www.cnblogs.com/jasonjiang/p/1763513.html