JQuery and frames - $(document).ready doesn't work

后端 未结 12 2377
长发绾君心
长发绾君心 2020-12-14 09:51

I have a page, with some code in js and jQuery and it works very well. But unfortunately, all my site is very very old, and uses frames. So when I loaded my page inside a fr

12条回答
  •  鱼传尺愫
    2020-12-14 10:04

    This answer may be late, but this reply may help someone like me...

    This can be done via native Javascript code -

    ifrm2 = var ifrm2 = document.getElementById('frm2');
    if (ifrm2.contentDocument.readyState == 'complete') {
      //here goes the code after frame fully loaded
    }
    
     //id = frm2 is the id of iframe in my page
    

提交回复
热议问题