1. <tt id="5hhch"><source id="5hhch"></source></tt>
    1. <xmp id="5hhch"></xmp>

  2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

    <rp id="5hhch"></rp>
        <dfn id="5hhch"></dfn>

      1. js+xml自動(dòng)生成表格的代碼

        時(shí)間:2020-11-10 10:57:45 XML DOM 我要投稿

        js+xml自動(dòng)生成表格的代碼

          復(fù)制代碼 代碼如下:

          

          

          

          無(wú)標(biāo)題文檔

          

          functionloadXML(handler){

          varurl="employees.xml";

          if(document.implementation&&document.implementation.createDocument){

          varxmldoc=document.implementation.createDocument("","",null);

          xmldoc.onload=handler(xmldoc,url);

          xmldoc.load(url);

          }

          elseif(window.ActiveXObject){

          varxmldoc=newActiveXObject("Microsoft.XMLDOM");

          xmldoc.onreadystatechange=function(){

          if(xmldoc.readyState==4)handler(xmldoc,url);

          }

          xmldoc.load(url);

          }

          }

          functionmakeTable(xmldoc,url){

          vartable=document.createElement("table");

          table.setAttribute("border","1");

          table.setAttribute("width","600");

          table.setAttribute("class","tab-content");

          document.body.appendChild(table);

          varcaption="EmployeeDatafrom"+url;

          table.createCaption().appendChild(document.createTextNode(caption));

          varheader=table.createTHead();

          varheaderrow=header.Row(0);

          headerrow.Cell(0).appendChild(document.createTextNode("姓名"));

          headerrow.Cell(1).appendChild(document.createTextNode("職業(yè)"));

          headerrow.Cell(2).appendChild(document.createTextNode("工資"));

          varemployees=xmldoc.getElementsByTagName("employee");

          for(vari=0;i<employees.length;i++){

          vare=employees[i];

          varname=e.getAttribute("name");

          varjob=e.getElementsByTagName("job")[0].firstChild.data;

          varsalary=e.getElementsByTagName("salary")[0].firstChild.data;

          varrow=table.Row(i+1);

          row.Cell(0).appendChild(document.createTextNode(name));

          row.Cell(1).appendChild(document.createTextNode(job));

          row.Cell(2).appendChild(document.createTextNode(salary));

          }

          }

          

          

          

          

          

          

          復(fù)制代碼 代碼如下:

          

          

          

          Programmer

          32768

          

          

          Sales

          70000

          

          

          CEO

          100000

          

          

        【js+xml自動(dòng)生成表格的代碼】相關(guān)文章:

        1.關(guān)于cad生成g代碼

        2.vbscript自動(dòng)配置IIS代碼

        3.PHP 透明水印生成代碼參考

        4.怎么自動(dòng)生成圖表目錄

        5.基于jQuery的固定表格頭部的代碼

        6.Java字符串反轉(zhuǎn)和Eclipse代碼自動(dòng)提示

        7.jQuery實(shí)現(xiàn)的拖動(dòng)調(diào)整表格單元格的大小代碼實(shí)例

        8.jQuery的合并表格中相同文本的相鄰單元格的代碼

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码

        1. <tt id="5hhch"><source id="5hhch"></source></tt>
          1. <xmp id="5hhch"></xmp>

        2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

          <rp id="5hhch"></rp>
              <dfn id="5hhch"></dfn>