Delay load of iframe?

后端 未结 10 1566
悲哀的现实
悲哀的现实 2021-02-19 06:15

I know there are some tools and techniques for delaying the load of javascript, but I have an iframe that I would like to delay loading until after the rest of the page has fini

10条回答
  •  悲哀的现实
    2021-02-19 06:44

    This works for me, but has problems if you change the code at all:

    function loadIFrame() {
        window.frames['BodyFrame'].document.location.href = "iframe.html";
    }         
    function delayedLoad() {
        window.setTimeout(loadIFrame2, 5000);
    }
    

    Using:

    
    

提交回复
热议问题