IE6“跨域浏览子框架”的真正含义

跨域浏览子框架(Navigate sub-frames across different domains)

微软给予的定义为:
This option controls whether readers of a Web page can navigate the sub-frame of a window with a top-level document that resides in a different domain. This option has the following settings:
 
Disable, which allows users to navigate only between Web page sub-frames that reside in the same domain.
 
Enable, which allows users to navigate between all Web page sub-frames, regardless of the domain, without being prompted.
 
Prompt, which prompts users to choose whether to navigate between Web page sub-frames that reside in different domains.

实际上,经过圣堂的测试,此行为的定义大致如下:

利用 a 或 form 等带有 target 属性的标签进行页面转向时:

针对 frameset:frameset 自己在什么域无所谓。其下的一个 frame,假设其为 frame1,此时内部的页面来自域1,上面的 a 或 form 无论朝向任何域;另一个 frame,假设其为 frame2,此时内部的页面来自域2,域2不等于域1;此时 frame1 利用 a 或 form 发出的 HTTP 请求改变被 target 指定的 frame2 内的页面,被叫做跨域浏览子框架。

针对 iframe:主页面来自域0,上面的 a 或 form 无论朝向任何域。其下的一个 iframe,假设其为 iframe1,此时内部的页面来自域1,域1不等于域0;此时主页面利用 a 或 form 发出的 HTTP 请求改变被 target 指定的 frame1 内的页面,被叫做跨域浏览子框架。如果 a 或 form 在 iframe1 内的页面上,与之前的 iframe 例子相比,主页面与 iframe1 内页面身份对换,跨域浏览子框架在 iframe1 与主页面间发生;如果有两个或更多 iframe,a 或 form 在 iframe2 内的页面上,与起初的 iframe 例子相比,主页面与 iframe2 内页面身份调换,跨域浏览子框架在 iframe2 与 iframe1 间发生。

IE7 的此项设置已经有所放水。自 IE8 起,此项设置改名为“跨域浏览窗口和框架(Navigate windows and frames across different domains)”。