Does about:blank work in all browsers?

后端 未结 6 756
孤街浪徒
孤街浪徒 2021-01-03 18:13

I have an iframe and I want to clear it, so I set its src to about:blank

Then I wondered, does this work in all browsers?

6条回答
  •  花落未央
    2021-01-03 18:54

    It's a requirement for HTML5 implementations to support about:blank. Also, about:blank is defined by RFC 6694.

    As for non-HTML5 web browsers, it depends. WorldWideWeb, Lynx, and some other browsers don't support about:blank – it wasn't a standard then. The about:blank itself initially appeared in Netscape Navigator 1. Internet Explorer copied that feature from Netscape, and other browsers copied it as well. If the browser supports frames, you can be almost sure it supports about:blank. Otherwise websites using frames with about:blank location created when Netscape was popular would show errors (or not show them, and effectively do what you wanted).

提交回复
热议问题