你用chrome的F12的页面工具,就可以看到他提示的错误:
Unsafe JavaScript attempt to access frame with URL file:///D:/temp/p.html from frame with URL file:///D:/temp/c.html. Domains, protocols and ports must match.
所以,当你放到服务器上面或者放到HTTP服务器上面就没有问题了。
你用chrome的F12的页面工具,就可以看到他提示的错误:
Unsafe JavaScript attempt to access frame with URL file:///D:/temp/p.html from frame with URL file:///D:/temp/c.html. Domains, protocols and ports must match.
所以,当你放到服务器上面或者放到HTTP服务器上面就没有问题了。