Iframe without src but still has content?

前端 未结 7 707
攒了一身酷
攒了一身酷 2020-12-05 06:56

While debugging jquery code on their site ( via chrome developer toolbar)

I noticed that their examples are given under Iframe :

Here - for ex

7条回答
  •  执笔经年
    2020-12-05 07:11

    Mixing best answers in javascript and jQuery, I come up with this solution for each iframe in a page:

    $(".iframewrapper").each(function(){ var html = $(this).attr("data-content"); var iframe = $(this).find('iframe'); var context = iframe[0].contentDocument.write(html); iframe[0].contentWindow.document.close(); //without this line, page loading animations won't go away! });

提交回复
热议问题