Javascript IE8:document.write给我打开的窗口;“访问被拒绝”;
:编辑开始: 我已经找到了原因,但还没有找到解决办法。在我的原始页面中,我有以下行:Javascript IE8:document.write给我打开的窗口;“访问被拒绝”;,javascript,internet-explorer,Javascript,Internet Explorer,:编辑开始: 我已经找到了原因,但还没有找到解决办法。在我的原始页面中,我有以下行: document.domain = "<mydomain>"; 有人能帮我吗 我试过了 var printWindow = window.open('**#**', 'Print', 'width=1000,height=700'); 我也试过了 printWindow.document.open(); 都是徒劳的…:-(它确实对我有用: 使用此代码:(与您的代码相同) var printW
document.domain = "<mydomain>";
有人能帮我吗
我试过了
var printWindow = window.open('**#**', 'Print', 'width=1000,height=700');
我也试过了
printWindow.document.open();
都是徒劳的…:-(它确实对我有用:
使用此代码:(与您的代码相同)
var printWindow=window.open(''Print','width=1000,height=700');
printWindow.document.open();
printWindow.document.write(“”);
printWindow.document.write('aaaaaa');
printWindow.document.write(“”);
printWindow.document.close();
printWindow.focus();
//printWindow.print();
//printWindow.close();
(纯ie8)它确实对我有用:
使用此代码:(与您的代码相同)
var printWindow=window.open(''Print','width=1000,height=700');
printWindow.document.open();
printWindow.document.write(“”);
printWindow.document.write('aaaaaa');
printWindow.document.write(“”);
printWindow.document.close();
printWindow.focus();
//printWindow.print();
//printWindow.close();
(纯ie8)我遇到了同样的问题,问题是确保
窗口.open('/'+window.location.hostname..
正常工作。我遇到了同样的问题,问题是确保窗口.open('/'+window.location.hostname..
使其正常工作。它在我的电脑上正常工作。您可以发布控制台或使用文档和浏览器模式吗?我收到的唯一错误是“访问被拒绝”从调试中我可以看出,当我试图访问printWindow.document时,我就出现了错误。就浏览器模式而言,我不确定你的意思。我的页面是OnPreInit(…),我有以下内容:Response.AddHeader(“X-UA-Compatible”,“IE=Edge”);。差不多就是这样。有问题的网站运行在哪个安全区域?(右键单击页面并选择“属性”)它在我的电脑上运行。你能发布控制台或文件和浏览器模式吗?我得到的唯一错误是“访问被拒绝”。从调试中我可以看出,只要我尝试访问printWindow.document,我就得到了错误。就浏览器模式而言,我不确定你的意思。我的页面在PreInit上(…)我有这样一个:Response.AddHeader(“X-UA-Compatible”,“IE=Edge”);。差不多就是这样。有问题的站点运行在哪个安全区域?(右键单击页面并选择属性)现在这很奇怪。我为atm工作的客户机是一家银行,它经历了各种各样的困难,以阻止在IE8中使用选项卡,并强制启用兼容性视图选项。这会导致我看到的行为吗?问:您是否真的使用了该名称窗口。open('*****'
?请尝试一个常规字符串(仅用于测试)。我稍后将使用兼容模式进行测试。否:-)首先我用“”进行了测试,然后用“#”进行了测试。后者只是重新加载我来自的页面。我只是试图突出显示磅符号:-)现在这很奇怪。我为atm工作的客户机是一家银行,它经历了各种各样的困难,以阻止在IE8中使用选项卡,并强制启用兼容性视图选项。这会导致我看到的行为吗?问:您是否真的使用了该名称窗口。open('*****'
?请尝试一个常规字符串(仅用于测试)。我稍后将使用兼容模式进行测试。否:-)首先我用“”进行了测试,然后用“#”进行了测试。后者只是重新加载我来自的页面。我只是试图突出显示磅符号:-)
var printWindow = window.open('**#**', 'Print', 'width=1000,height=700');
printWindow.document.open();
var printWindow = window.open('', 'Print', 'width=1000,height=700');
printWindow.document.open();
printWindow.document.write('<html xmlns="http://www.w3.org/1999/xhtml">');
printWindow.document.write('<body>aaaaaaaa</body>');
printWindow.document.write('</html>');
printWindow.document.close();
printWindow.focus();
// printWindow.print();
// printWindow.close();