打印窗口没有在chrome中打开,但它在其他浏览器中工作 [英] print window not opening in chrome but it working in other browser

查看:118
本文介绍了打印窗口没有在chrome中打开,但它在其他浏览器中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  var  windowUrl = '  mypage.aspx?sId =' + sid + ' & sname =' + sname + ' & sdt =' + sdate; 
var uniqueName = new 日期();
var windowName = ' Print' + uniqueName.getTime();
var printWindow = window .open(windowUrl,windowName,' left = 0,top = 0,width = 100,height = 100');





它在其他浏览器中工作但不能用于chrome

解决方案

我想在你的应用程序的Chrome中阻止弹出窗口。



允许弹出窗口,它会显示窗口。我尝试了我的工作。





[更新]



与OP讨论后,这是我的建议并且有效。



然后检查它在我的演示中是如何工作的



[问题]打印窗口未在chrome中打开但在其他浏览器中有效 [ ^ ]



我提供的值为......

<前lang =text> var sid = 1;
var sname =Renuka;
var sdate =31/12/2013​​;



如果您看到代码,那么您可以知道。



确保 Developer Tool的控制台选项卡中没有错误。

接下来要确保的值为sid sname sdate 正常运行。

如果任何这些值都丢失或 null undefined ,那么它就不会打开任何窗口。


var windowUrl = 'mypage.aspx?sId=' + sid + '&sname=' + sname + '&sdt=' + sdate;
          var uniqueName = new Date();
          var windowName = 'Print' + uniqueName.getTime();
          var printWindow = window.open(windowUrl, windowName, 'left=0,top=0,width=100,height=100');



it working in other browser but not working in chrome

解决方案

I guess Popups are blocked in Chrome for your App.

Allow Popup, it will show you the window. I tried at my end and it is working.


[Update]

After discussion with OP, here is what I suggested and it worked.

Then check how it is working in my Demo

[Issue] print window not opening in chrome but it is working in other browser[^]

I have provided values as...

var sid = 1;
var sname = "Renuka";
var sdate = "31/12/2013";


If you will see the code, then you can know.

Make sure there are no errors in Developer Tool's Console tab.
Next thing is make sure the values of sid, sname and sdate are coming properly.
If any of these values are missing or null or undefined, then it would not open any window.


这篇关于打印窗口没有在chrome中打开,但它在其他浏览器中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆