Return ID of all iframes in a page

前端 未结 3 728
我寻月下人不归
我寻月下人不归 2021-01-18 22:38

Because of the widget format I\'m working with I have a page which has multiple iframes embedded within iframes. I won\'t paste the code as it\'s vast and unwieldy but it is

3条回答
  •  终归单人心
    2021-01-18 23:01

    I do not believe you can reference the iframe's children directly. You will need to recursively search each iframe using it's .contents() call.

    As far as I know, this will only work as long as the same-origin policy is not violated (i.e. the iframes must point to the same domain).

提交回复
热议问题