是什么让jQuery.印刷从工作与传单
What is keeping jQuery.print from working with Leaflet?
在测试使用jQuery的git repo时。打印(在这里演示),我得到以下错误:
[Exception... "The operation is insecure." code: "18" nsresult: "0x80530012 (SecurityError)" location: "<unknown>"]
我用jQuery在本地的传单实例上测试了这一点。通过将以下内容粘贴到控制台中打印,并且能够复制它:
$.print("map" /*, options*/);
[Exception... "The operation is insecure." code: "18" nsresult: "0x80530012 (SecurityError)" location: "<unknown>"]
"Failed to print from iframe" undefined "The operation is insecure." jQuery.print.js:141
$.fn.print() jQuery.print.js:141
<anonymous function> debugger eval code:1
即使我禁用了为打印构建iframe的选项,也会发生这种情况:
$("map").print({
addGlobalStyles : true,
stylesheet : null,
rejectWindow : true,
noPrintSelector : ".no-print",
iframe : false,
append : null,
prepend : null
});
[Exception... "The operation is insecure." code: "18" nsresult: "0x80530012 (SecurityError)" location: "<unknown>"]
jQuery。打印演示本身在我的机器上工作良好。为什么将它与传单混合使用会产生安全错误?
原因是同源策略—除非使用CORS请求图像,否则它们会在浏览器中触发此安全问题。
相关文章:
- 不正确的工作jquery插件bxslider与插件elevatezoom
- 更改图像src-dons't工作jquery/js
- event.prventDefault()不工作(jQuery实时)
- delay()不会'第二次工作jquery
- 如何工作 jQuery 就绪
- 几天后,昨天停止工作jQuery
- .click() 不再工作 jquery.
- 如何使工作jquery"“滑动”;在iPad上滚动
- 为什么不是't这个选择器正在工作(Jquery和Asp.net)
- Flexslider无法在html网站中工作(jQuery无法加载?)
- 点击,点击不工作?jquery
- 按钮在“加”和“减”之间切换,需要“点击”;只能在fa +上工作.jQuery
- 突出显示搜索列表不工作(jquery问题)
- 页眉内的Div /靠近页面顶部/在2次点击事件后不显示,而它的's页脚双胞胎工作- jquery
- 为什么css后台jQuery代码不工作jQuery设置多个css值
- .stop()不是't使用我的悬停,使快速移动工作-jQuery
- 自定义验证方法不工作- jQuery验证插件
- 数据表columnDefs不工作:jquery / javascript
- 工作jQuery代码赢得'不要在电话间隙跑步
- 我的Javascript代码不工作- Jquery选择器问题