我在 Chrome 中打开一个窗口/标签:
childWin = window.open('child.html');
然后我尝试在孩子中调用一个函数:
childWin.objReceiver( {foo: 'blah', zoo: 'bing'} );
但我在 Chrome 父级中收到以下 2 个错误(Firefox 工作正常):
Unsafe JavaScript attempt to access frame with URL file:///C:/Users/Slava/Documents/AMP/app_poc/test/child.html from frame with URL file:///C:/Users/Slava/Documents/AMP/app_poc/test/index.html#. Domains, protocols and ports must match.
Uncaught TypeError: Property 'objReceiver' of object [object Window] is not a function
请指教。