如何设置跨域iframe的焦点

问题描述 投票:0回答:1

类似于以下帖子:

  1. Set focus on iframe in Chrome

  2. Setting focus to iframe contents

从根目录/父目录开始,我希望能够将焦点传递给iframe。

iframe中可能需要重点关注的一切都很好。

iframe.contentWindow.focus();

但是,由于iframe.contentWindow是跨域框架,因此无法访问。

javascript jquery google-chrome iframe cross-domain
1个回答
0
投票

似乎答案是:不可能。

如果iframe中正在运行脚本,则可以直接在其中调用焦点。

© www.soinside.com 2019 - 2024. All rights reserved.