iframe contentWindow is undefined when use window.frames[name] to access

前端 未结 1 1733
暗喜
暗喜 2021-01-04 14:46

If use following way to get the contentWindow, the value is undefined



    iframe test

<         


        
1条回答
  •  离开以前
    2021-01-04 15:46

    window.frames["frame1"];
    

    is the contentWindow, it get's a named window, and in your case it's the same thing as

    document.getElementById("frame1").contentWindow
    

    FIDDLE

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