• <tfoot id='zTqET'></tfoot>

        <legend id='zTqET'><style id='zTqET'><dir id='zTqET'><q id='zTqET'></q></dir></style></legend>

        <small id='zTqET'></small><noframes id='zTqET'>

        <i id='zTqET'><tr id='zTqET'><dt id='zTqET'><q id='zTqET'><span id='zTqET'><b id='zTqET'><form id='zTqET'><ins id='zTqET'></ins><ul id='zTqET'></ul><sub id='zTqET'></sub></form><legend id='zTqET'></legend><bdo id='zTqET'><pre id='zTqET'><center id='zTqET'></center></pre></bdo></b><th id='zTqET'></th></span></q></dt></tr></i><div id='zTqET'><tfoot id='zTqET'></tfoot><dl id='zTqET'><fieldset id='zTqET'></fieldset></dl></div>
          <bdo id='zTqET'></bdo><ul id='zTqET'></ul>

        IE 10:SCRIPT5:锚点点击事件上的访问被拒绝错误

        IE 10: SCRIPT5: Access is Denied error on anchor click event(IE 10:SCRIPT5:锚点点击事件上的访问被拒绝错误)

      1. <small id='lamlv'></small><noframes id='lamlv'>

          <tbody id='lamlv'></tbody>
        <tfoot id='lamlv'></tfoot>

        <legend id='lamlv'><style id='lamlv'><dir id='lamlv'><q id='lamlv'></q></dir></style></legend>

          <bdo id='lamlv'></bdo><ul id='lamlv'></ul>

                • <i id='lamlv'><tr id='lamlv'><dt id='lamlv'><q id='lamlv'><span id='lamlv'><b id='lamlv'><form id='lamlv'><ins id='lamlv'></ins><ul id='lamlv'></ul><sub id='lamlv'></sub></form><legend id='lamlv'></legend><bdo id='lamlv'><pre id='lamlv'><center id='lamlv'></center></pre></bdo></b><th id='lamlv'></th></span></q></dt></tr></i><div id='lamlv'><tfoot id='lamlv'></tfoot><dl id='lamlv'><fieldset id='lamlv'></fieldset></dl></div>
                  本文介绍了IE 10:SCRIPT5:锚点点击事件上的访问被拒绝错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 javascript 将画布中的 SVG 保存为 PNG 文件.以下代码似乎在 Chrome 和 Firefox 上运行良好,但在 IE 10 中,我在控制台中收到以下错误.

                  I'm trying to save a SVG from a canvas as PNG file using javascript. The below code seems to work fine on Chrome and Firefox, but in IE 10 i get the below error in my console.

                  SCRIPT5:访问被拒绝.

                  SCRIPT5: Access is denied.

                  在我用过的代码下面找到:

                  FInd below the code that I've used:

                  var image = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
                  
                  var a = $('<a>').attr("href", canvas.toDataURL("image/png")).attr("download", title + "png").appendTo($('#VisitsContainer'));
                  
                  a[0].click();
                  a.remove();
                  

                  控制台指向我试图调用的点击事件.

                  The console points to the click event that I'm trying to invoke.

                  推荐答案

                  download 属性未在 Internet Explorer 中实现.

                  The download attribute is not implemented in Internet Explorer.

                  http://caniuse.com/download

                  对于 Internet Explorer,您可以使用另存为"命令.

                  For Internet explorer you can use the "SaveAs" command.

                  关于安全性的说明:

                  浏览器服务于 2 个主机.

                  Browsers serve 2 masters.

                  浏览器必须满足用户将内容保存到本地驱动器的请求.

                  Browsers must serve the user's request to save content to their local drive.

                  浏览器还必须限制潜在的恶意代码自动将位下载到用户本地驱动器上.

                  Browsers must also restrict potentially malicious code from automatically downloading bits onto the users local drive.

                  为了协调这两个任务,浏览器采用的方法是用户可以在经过一些确认过程(如保存按钮)后将内容下载到本地驱动器.

                  To reconcile the 2 tasks, browsers take the approach that users can download content to their local drive after some confirming process (like a Save button).

                  使用 a[0].click(); 为用户确认运行与浏览器提供安全性的尝试相反.

                  Using a[0].click(); to confirm for the user runs contrary to the browser's attempt to provide security.

                  FileSave.js 是一个跨浏览器库,可将您的画布保存到用户本地驱动器.它通过要求用户单击按钮来确定下载来符合安全问题.

                  FileSave.js is a cross-browser library that will save your canvas to the users local drive. It conforms to security issues by requiring the user to click a button to OK the download.

                  https://github.com/eligrey/FileSaver.js/

                  这篇关于IE 10:SCRIPT5:锚点点击事件上的访问被拒绝错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to make rooftext effect and valley text effect in HTML5 (or Fabric.js)(如何在 HTML5(或 Fabric.js)中制作屋顶文字效果和山谷文字效果)
                  Draw border around nontransparent part of image on canvas(在画布上的图像不透明部分周围绘制边框)
                  dragging and resizing an image on html5 canvas(在 html5 画布上拖动图像并调整其大小)
                  What#39;s the difference between a boolean as primitive and a boolean as property of an object?(作为原始对象的布尔值和作为对象属性的布尔值有什么区别?)
                  I want to do animation of an object along a particular path(我想沿特定路径对对象进行动画处理)
                  How to upload image into HTML5 canvas(如何将图像上传到 HTML5 画布中)

                  1. <tfoot id='HyNgW'></tfoot>
                      <i id='HyNgW'><tr id='HyNgW'><dt id='HyNgW'><q id='HyNgW'><span id='HyNgW'><b id='HyNgW'><form id='HyNgW'><ins id='HyNgW'></ins><ul id='HyNgW'></ul><sub id='HyNgW'></sub></form><legend id='HyNgW'></legend><bdo id='HyNgW'><pre id='HyNgW'><center id='HyNgW'></center></pre></bdo></b><th id='HyNgW'></th></span></q></dt></tr></i><div id='HyNgW'><tfoot id='HyNgW'></tfoot><dl id='HyNgW'><fieldset id='HyNgW'></fieldset></dl></div>
                        <tbody id='HyNgW'></tbody>
                        <bdo id='HyNgW'></bdo><ul id='HyNgW'></ul>

                        <small id='HyNgW'></small><noframes id='HyNgW'>

                      • <legend id='HyNgW'><style id='HyNgW'><dir id='HyNgW'><q id='HyNgW'></q></dir></style></legend>