• record test code for svn sources


    var abc = function() {
        var fbtg = document.getElementsByClassName('ft-bg');
        if (fbtg.length > 0) {
            for (var i=0;i<fbtg.length;i++) {
              fbtg[i].parentNode.removeChild(fbtg[i]);
            }
        }
        var newEle = document.createElement('div');
        newEle.setAttribute('style', 'background:gray;100%;height:10000px;position:absolute;top:0px;left:0px;');
        newEle.setAttribute('class', 'ft-bg');
        var c = '';
        var a = document.getElementsByTagName('a');
        for (var i=0; i < a.length; i++) {
          var temp = a[i].innerHTML;
          var houzhui = ['.png','.jpg','.jpeg'];
          var hasHouzhui = false;
          for (var j=0; j < houzhui.length; j++) {
            if (temp.indexOf(houzhui[j]) != -1) {
               hasHouzhui = true;
             }
          }
          if (hasHouzhui) {
            c += '<a href="'+a[i].innerHTML+'"><img style="40px;" src="'+a[i].innerHTML+'"/></a>';
          }
        }
        newEle.innerHTML = c;
        var body = document.getElementsByTagName('body');
        //console.info(newEle, body[0]);
        body[0].appendChild(newEle);
        return 'run success';
    };
    abc();
  • 相关阅读:
    es6-箭头函数
    高度自适应的div
    移动端css水平垂直居中
    跨域2-常用的跨域方式
    跨域1-CORS跨域
    前端路由分类
    K8S系列-2.常用命令
    Git多分支管理
    微服务-01初识
    VirtualBox虚拟Centos磁盘文件扩容
  • 原文地址:https://www.cnblogs.com/SATinnovation/p/10521757.html
Copyright © 2020-2023  润新知