Passing data between frames with Javascript

后端 未结 2 1022
时光说笑
时光说笑 2021-01-16 22:29

I\'ve setup a simple example at http://ryanmalin.co.uk/frames/

If you press \"add\" it will paste the form data from the left frame into the right frame.

Whe

相关标签:
2条回答
  • 2021-01-16 23:00

    This is not possible. It's a deliberate browser restriction for security.

    0 讨论(0)
  • 2021-01-16 23:11

    See the "Same Origin Policy" for a description of how inter frame security works. In a nutshell, there is very little communication allowed between frames on a different domain for security reasons. You cannot make any direct Javascript calls between frames on different domains.

    HTML5 has a new messaging system that can safely communicate data (not direct JS calls) between cooperating frames in different domains. See here and here for a description of how the HTML5 messaging works.

    0 讨论(0)
提交回复
热议问题