Do frames and iframes have isolated javascript contexts?

后端 未结 4 1112
孤街浪徒
孤街浪徒 2021-01-04 17:27

I\'ve made some experiments in Chrome but I\'m not sure so I need a confirmation :

Am I correct in thinking that iframes and frames have a separate JavaScript contex

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-04 18:04

    Yes.

    However, you can use the frames collection or the parent to access other frames (assuming they're from the same domain).

提交回复
热议问题