在阅读 Outlook 文档后,我显然很清楚我可以生成 OUTLOOK 日历的 html 链接并将其嵌入到任何网页。当我如下创建 iframe 时效果很好
<iframe width="900" height="500" src="https://cpgd-ab67acdd3e1c401a.calendar.live.com/calendar/private/blalaba-balajahhhdh-342d-4cea-ad46-25433581e015/index.html"></iframe>
并将其插入到我现有的页面中。我的问题是:页面加载后,它会重定向/导航父窗口/页面,并用完整的 Outlook 日历完全替换我的 DOM。我的目的只是将其放在页面的特定部分(确切地说是 DIV)。
我已经尝试过
- 使用新的 HTML5 沙箱属性对 iframe 进行沙箱处理。上 控制台,它会抛出错误。
- 我也尝试过使用ajax单独加载iframe。相同的 错误和失败。
我确信此行为是故意的 微软。我需要一种方法来绕过这个。
最佳答案
这可能对你有一点帮助,我在网站上共享日历时使用过这个,你可以根据需要配置CSS
<style unselectable="on">
#wrap {
width:1000px;
height:900px;
padding:0;
position:relative;
left:0px;
top:0px;
overflow:hidden;
}
#frame {
width:1000px;
height:900px;
position:relative;
left:0px;
top:0px;
}
#frame {
-ms-zoom:0.7;
}
</style>
<div id="wrap" unselectable="on">
<iframe id="frame" src="[paste in here the link that outlook.com provides for you ... in between the quotes and without the brackets]"></iframe>
</div>
关于javascript - 将 Outlook 日历嵌入网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20354254/