有人让 IE8 读取编码为 base64 数据 URI 的 DHTML 行为吗?
这是我正在编码的 HTC 内容(没什么花哨的):
<public:component> <script type="text/javascript"> alert('data URI'); </script> </public:component>
这是 CSS 文件中的定义,上面的组件是 base64'd:
.something { -ms-behavior: url(data:text/x-component;base64,PHB1YmxpYzpjb21wb25lbnQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPmFsZXJ0KCdiYXNlNjQnKTs8L3NjcmlwdD48L3B1YmxpYzpjb21wb25lbnQ+); }
似乎不起作用......尽管当我将上面的组件保存到文件中时,并在 behavior
属性中引用它,我收到警报。 我记得有一个公告称行为现在可以容纳在 IE8 中的数据 URI 中......我认为这是从我们手中夺走动态属性(CSS 表达式)的权衡。 这是错误的吗?
Here is the HTC content I'm encoding (nothing fancy):
<public:component> <script type="text/javascript"> alert('data URI'); </script> </public:component>
Here is the definition in the CSS file, with the above component base64'd:
.something { -ms-behavior: url(data:text/x-component;base64,PHB1YmxpYzpjb21wb25lbnQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPmFsZXJ0KCdiYXNlNjQnKTs8L3NjcmlwdD48L3B1YmxpYzpjb21wb25lbnQ+); }
Doesn't seem to work...although when I save the above component to a file, and reference it in the behavior
property, I get my alert. I remember an announcement that behaviors could now be housed in data URIs in IE8...I thought that was the trade off for taking dynamic properties (CSS expressions) away from us. Is this wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,没有添加 DATA URI 来补偿 CSS 表达式的删除。
仅在 IE8 标准模式页面中受支持,数据 URI 的长度限制为 32kb,并且不能用于脚本执行或导航目的。
如果您查看 IE8 错误控制台,您将看到:
网页错误详细信息
消息:访问被拒绝:data:text/x-component;base64,PHB1YmxpYzp...
No, DATA URIs were not added to compensate for the removal of CSS expressions.
Supported only in IE8 Standards Mode pages, Data URIs are limited to 32kb in length, and cannot be used for script-execution or navigation purposes.
If you look in the IE8 error console, you'll see:
Webpage error details
Message: Access is denied to: data:text/x-component;base64,PHB1YmxpYzp...