zoukankan      html  css  js  c++  java
  • iframe框架加载完成后执行函数

    //方法一
    var iframe = document.createElement("iframe"); iframe.src = "http://www.baidu.com/"; if (!/*@cc_on!@*/0) { //if not IE iframe.onload = function(){ alert("框架加载完毕."); }; } else { iframe.onreadystatechange = function(){ if (iframe.readyState == "complete"){ alert("框架加载完毕."); } }; } document.body.appendChild(iframe); //方法二 var iframe = document.createElement("iframe"); iframe.src = "http://www.baidu.com/"; if (iframe.attachEvent){ iframe.attachEvent("onload", function(){ alert("Local iframe is now loaded."); }); } else { iframe.onload = function(){ alert("Local iframe is now loaded."); }; } document.body.appendChild(iframe);
    //应用实例
    created() { let resTypeId = this.$route.query.resTypeId; let resId = this.$route.query.resId; const vm = this; vm.$http("XXXXXXXXXXX", { resTypeId: resTypeId, resId: resId, previewFlag: 0 }).then(res => { vm.contentlist = res.data.contentList; setTimeout(function () { var iframes = document.getElementById('IFrame'); iframes.src = res.data.contentList[0].contentFileUrl; if (! /*@cc_on!@*/ 0) { //if not IE iframes.onload = function () { vm.isloadingsvg = true;//关闭loading } } else { iframes.onreadystatechange = function () { if (iframes.readyState == "complete") { vm.isloadingsvg = true;//关闭loading } } } }) }); },

     原文链接:https://www.cnblogs.com/supe/p/7345078.html

  • 相关阅读:
    详解EBS接口开发之采购申请导入
    EBS HRMS数据表
    会计期间
    帐套和会计科目的理解
    oracle中动态SQL详解
    不同币种汇率转换
    API创建/更新员工联系电话
    API创建/更新员工薪水
    Android 圆形、圆角图片ImageView
    Knowledge Generation Model for Visual Analytics
  • 原文地址:https://www.cnblogs.com/hdff/p/10410521.html
Copyright © 2011-2022 走看看