繁体   English   中英

window.print html 与 ajax

[英]window.print html with ajax

如何在ajax中使用window.print html?

在我的成功回调中

,
success(data){

//how to print the html in a new page?
}

我试过

var invoice = window.open(data, '_blank');
setTimeout(invoice.print(), 5);

setTimeout采用未执行的函数(不带括号)或匿名函数。 反正我会这样做:

var invoice = open(data);
invoice.onload = function(){
  this.print();
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM