javascript:使用数据uri显示xml流

标签 javascript xml internet-explorer

我已完成以下操作以将我的 xml 显示到新的浏览器窗口中:

window.open('data:text/xml,' + encodeURIComponent( '<?xml version="1.0" encoding="utf-8"?><Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"><parent>test</parent></Document>' ));

在所有浏览器中都能很好地工作...但显然是 IE。我正在使用 IE10。我应该怎么做才能让它发挥作用?现在,xml 是 URL 编码的,不会显示在新窗口中。

最佳答案

来自data Protocol MSDN 库中的文章:

For security reasons, data URIs are restricted to downloaded resources. Data URIs cannot be used for navigation, for scripting, or to populate frame or iframe elements.

关于javascript:使用数据uri显示xml流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17595729/

相关文章:

javascript - 随机 body 背景图像

javascript - ajax返回空白数据

html - 将 XElement 转换为 HTML 字符串

python - 如何使用 beautifulsoup 获取原始文本?

internet-explorer - 有没有办法在 Blue Prism 中应用 "activate"html?

javascript - Intranet 站点的 IE9 兼容模式具有错误的用户代理字符串

javascript - 将工作表添加到用户选择的excel文件中

javascript - 多次设置 Javascript 属性

javascript - jQuery 对数字输入没有反应

java - Spring - cURLS 不使用 Jackson XML Mapper 反序列化