阅读 65

IFRAME without src attribute on HTTPS in Internet Explorer

This took me quite some time to debug. Once again it made me realize why I hate hate hate Internet Explorer.

If you have a webpage on a HTTPS server with the following iframe code where you leave the src out:
<iframe id="if"></iframe>
and you view the page in Internet Explorer you'll get the following very descriptive warning.
This page contains both secure and nonsecure items
Clicking on the More Info button doesn't give you which items it's referring to, but just a help file.

Mozilla Firefox correctly doesn't produce this error.

Leaving the src attribute out of the iframe is common, when you want to fill the src attribute programmatically.

The solution you ask? Create a blank.html page and then write:
<iframe id="if" src="blank.html"></iframe>
The blank.html only contains <html></html>


文章分类
代码人生
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐