Print函数停止jquery post
Print function stops jquery post
我正在codeigniter的web应用程序上工作。我张贴到控制器使用jquery post函数,并在下一行我调用打印函数。当我评论这个打印函数时,jquery post工作正常,但否则jquery post不工作。
我在chrome中得到这个错误:请求头警告临时头显示
我代码:$.post("<?=base_url()?>appointments/getAppointmentCount", {'customer_code':customer_code}, function(data) {
alert("");
var appoCountObj = JSON.parse(data);
console.log(appoCountObj);
printbill();
});
function printbill()
{
/*print bill in popup*/
var printContent = $("#PreviewBillModal .modal-body").html();
var myWindow=window.open('', 'PrintWindow', 'width=950,height=850,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes,minimizable=no');
myWindow.document.writeln('<!DOCTYPE html>');
myWindow.document.writeln('<html><head><title></title>');
myWindow.document.writeln("<link rel='stylesheet' type='text/css' href='<?=base_url()?>css/style.css' />");
myWindow.document.writeln('</head><body>')
myWindow.document.write(printContent);
myWindow.document.writeln('</body></html>');
myWindow.document.close();
myWindow.focus();
myWindow.print();
myWindow.close();
}
请帮忙,由于
这是因为打印对话框延迟了。尝试设置一个小延迟:
setTimeout(function() {
printbill();
},100);
相关文章:
- Jquery POST未填充数组
- 防止双击执行两次jQuery post请求
- Jquery post and onclick
- jQuery$.post TypeError:e.type不是函数
- jQuery$.post可以在chrome、safari中工作,但不能在FF中工作(声明成功回调函数未定义)
- jQuery post,访问responseType或回调中的响应
- jquery post.fail,即使php成功
- 用jquery post发送jquery对象
- JQuery $.post() and curl
- 如何在 jquery post request 中发送api_key和api_secret参数
- Jquery Post Empty即使发送变量有数据
- 将 throbber 添加到 jQuery post()
- JQuery$.post第二次点击不起作用
- Ajax jquery post发布时没有变量名
- 404调用jQuery.post时出错
- Jquery Post方法在本地工作,但在服务器上不工作
- 从aspx.cs页面获取jquery post中的Null响应而不是json
- jQuery POST to PHP显示在浏览器中,但不显示在PHP文件中
- jquery $.post explain
- Jquery POST unicode字符串到codeigniter php