zoukankan      html  css  js  c++  java
  • 第十周作业

    json代码:

    {
      "squadName" : "intriduce the QQ speed",
      "The publishing company" : "Tencent____",
      "data" : 2017,
      "secretBase" : "Super tower",
      "active" : true,
      "members" : [
        {
          "name" : "Personal racing",
          "countDown" : "10",
          "feature" : "gas collection",
          "powers" : [
            "drifting",
            "gas escape",
            "strike"
          ]
        },
        {
         "name" : "team racing",
          "countDown" : "10",
          "feature" : "blue gas collection",
          "powers" : [
            "temp helps",
            "common victory",
            "havae a sense of unity"
          ]
        },
        {
          "name" : "Encounter racing",
          "countDown" : "10",
          "feature" : "Transmission and Acceleration",
          "powers" : [
            "talk with opposite sex",
            "make frieds",
            "may get married"
          ]
        }
      ]
    }
    js代码:
    var header = document.querySelector('header');
    var section = document.querySelector('section');
    var requestURL = 'https://raw.githubusercontent.com/qwe13404033685/qwwert/master/yuan.json';
    var request = new XMLHttpRequest();
    request.open('GET',requestURL);
    request.responseType = 'json';
    request.send();
    request.onload = function() {
      var superHeroes = request.response;
      populateHeader(superHeroes);
      showHeroes(superHeroes);
    }
    function populateHeader(jsonObj) {
      var myH1 = document.createElement('h1');
      myH1.textContent = jsonObj['squadName'];
      header.appendChild(myH1);
      var myPara = document.createElement('p');
      myPara.textContent = 'The publishing company:' + jsonObj['The publishing company'] + ' data: ' + jsonObj['data'];
      header.appendChild(myPara);
    }
    function showHeroes(jsonObj) {
      var heroes = jsonObj['members'];
          
      for (var i = 0; i < heroes.length; i++) {
        var myArticle = document.createElement('article');
        var myH2 = document.createElement('h2');
        var myPara1 = document.createElement('p');
        var myPara2 = document.createElement('p');
        var myPara3 = document.createElement('p');
        var myList = document.createElement('ul');
        myH2.textContent = heroes[i].name;
        myPara1.textContent = 'feature: ' + heroes[i].feature;
        myPara2.textContent = 'count down: ' + heroes[i].countDown;
        myPara3.textContent = 'The racing way';
            
        var superPowers = heroes[i].powers;
        for (var j = 0; j < superPowers.length; j++) {
          var listItem = document.createElement('li');
          listItem.textContent = superPowers[j];
          myList.appendChild(listItem);
        }
        myArticle.appendChild(myH2);
        myArticle.appendChild(myPara1);
        myArticle.appendChild(myPara2);
        myArticle.appendChild(myPara3);
        myArticle.appendChild(myList);
        section.appendChild(myArticle);
      }
    }
  • 相关阅读:
    升/降压转换器 (Buck-boost)
    升压转换器 (Boost)
    降压转换器 (Buck)
    线性稳压器 (LDO)
    电源管理组件选择指南
    AC/DC 反激 (Flyback) 控制器
    SEPIC 单端初级电感转换器 稳压器 -- Zeta 转换器
    LT3759 宽输入电压范围升压 / 负输出 / SEPIC 控制器 可在输入电压低至 1.6V 的情况下工作
    LT1961 升压型稳压器造就了兼具升压和降压能力的扁平状SEPIC
    Level-shifting nixes need for dual power supply
  • 原文地址:https://www.cnblogs.com/thelover527/p/10186925.html
Copyright © 2011-2022 走看看