【发布时间】:2019-03-25 20:22:50
【问题描述】:
我有一个嵌入 HTML 内容的基本 iframe。我应用了一种解决方法让它在 IE11 中工作,但在 Edge 中不起作用。在 Chrome 和 FireFox 中运行良好。我有一半的用户在 Edge...
<iframe
title="My iframe should work"
class="large"
id="my-slide-should-work"
src="javascript: window.frameElement.getAttribute('srcdoc');" // this fixed it for IE11
scrolling="no"
srcdoc='<!DOCTYPE html><html>all the goodness</html>'>
</iframe>
Edge 只显示一个空格,关于 JS 的错误提示
SCRIPT5007: SCRIPT5007: Unable to get property 'getAttribute' of undefined or null reference
javascript: window.frameElement.getAttribute('srcdoc'); (1,2)
【问题讨论】:
标签: iframe microsoft-edge