微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javascript:使用数据uri显示xml流

我已完成以下操作以将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编码,并且不会显示在新窗口中.

解决方法:

从MSDN库中的data Protocol文章

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.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。