⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 代码清单2-15.htm

📁 《深入浅出Ajax》 源代码
💻 HTM
📖 第 1 页 / 共 3 页
字号:
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>// </span><span
style='font-size:9.0pt;font-family:仿宋_GB2312;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"MS Reference Sans Serif";mso-bidi-font-family:"Times New Roman"'>创建一个</span><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>&lt;<span class=SpellE>tr</span>&gt;</span><span
style='font-size:9.0pt;font-family:仿宋_GB2312;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"MS Reference Sans Serif";mso-bidi-font-family:"Times New Roman"'>元素</span><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'><o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#020<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
class=SpellE>current_row</span> = <span class=SpellE><span class=GramE>document.createElement</span></span><span
class=GramE>(</span>&quot;<span class=SpellE>tr</span>&quot;);<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#021<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>// </span><span
style='font-size:9.0pt;font-family:仿宋_GB2312;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"MS Reference Sans Serif";mso-bidi-font-family:"Times New Roman"'>创建一个</span><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>&lt;td&gt;</span><span style='font-size:9.0pt;font-family:
仿宋_GB2312;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"MS Reference Sans Serif";
mso-bidi-font-family:"Times New Roman"'>元素</span><span lang=EN-US
style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'><o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#022<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
class=SpellE>current_cell</span> = <span class=SpellE><span class=GramE>document.createElement</span></span><span
class=GramE>(</span>&quot;td&quot;);<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#023<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>//</span><span
style='font-size:9.0pt;font-family:仿宋_GB2312;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"MS Reference Sans Serif";mso-bidi-font-family:"Times New Roman"'>创建一个文本节点</span><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'><o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#024<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
class=SpellE>currenttext</span> = <span class=SpellE>document.createTextNode</span>(&quot;</span><span
style='font-size:9.0pt;font-family:仿宋_GB2312;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"MS Reference Sans Serif";mso-bidi-font-family:"Times New Roman"'>单元格</span><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>&quot;);<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#025<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>// </span><span
style='font-size:9.0pt;font-family:仿宋_GB2312;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"MS Reference Sans Serif";mso-bidi-font-family:"Times New Roman"'>将创建的文本节点添加到</span><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>&lt;td&gt;</span><span style='font-size:9.0pt;font-family:
仿宋_GB2312;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"MS Reference Sans Serif";
mso-bidi-font-family:"Times New Roman"'>里</span><span lang=EN-US
style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'><o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#026<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
class=SpellE>current_<span class=GramE>cell.appendChild</span></span><span
class=GramE>(</span><span class=SpellE>currenttext</span>);<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#027<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#028<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>// </span><span
style='font-size:9.0pt;font-family:仿宋_GB2312;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"MS Reference Sans Serif";mso-bidi-font-family:"Times New Roman"'>将列</span><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>&lt;td&gt;</span><span style='font-size:9.0pt;font-family:
仿宋_GB2312;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"MS Reference Sans Serif";
mso-bidi-font-family:"Times New Roman"'>添加到行</span><span lang=EN-US
style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>&lt;<span class=SpellE>tr</span>&gt;<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#029<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
class=SpellE>current_<span class=GramE>row.appendChild</span></span><span
class=GramE>(</span><span class=SpellE>current_cell</span>);<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#030<span style='mso-spacerun:yes'>&nbsp; </span>// </span><span
style='font-size:9.0pt;font-family:仿宋_GB2312;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"MS Reference Sans Serif";mso-bidi-font-family:"Times New Roman"'>将行</span><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>&lt;<span class=SpellE>tr</span>&gt;</span><span
style='font-size:9.0pt;font-family:仿宋_GB2312;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"MS Reference Sans Serif";mso-bidi-font-family:"Times New Roman"'>添加到</span><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>&lt;<span class=SpellE>tbody</span>&gt;<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#031<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
class=SpellE><span class=GramE>tablebody.appendChild</span></span><span
class=GramE>(</span><span class=SpellE>current_row</span>);<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#<span class=GramE>032<span style='mso-spacerun:yes'>&nbsp;
</span>}</span><o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#<span class=GramE>033<span style='mso-spacerun:yes'>&nbsp;
</span>&lt;</span>/script&gt;<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#<span class=GramE>034<span style='mso-spacerun:yes'>&nbsp;
</span>&lt;</span>/head&gt;<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#<span class=GramE>035<span style='mso-spacerun:yes'>&nbsp;
</span>&lt;</span>body <span class=SpellE>onload</span>=&quot;start()&quot;&gt;<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#036<span style='mso-spacerun:yes'>&nbsp; </span><span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;input
type=&quot;button&quot; <span class=SpellE>onclick</span>=<span class=SpellE>insertRow</span>()
value=</span><span style='font-size:9.0pt;font-family:仿宋_GB2312;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"MS Reference Sans Serif";mso-bidi-font-family:
"Times New Roman"'>增加行</span><span lang=EN-US style='font-size:9.0pt;
mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:"Times New Roman"'>&gt;<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#<span class=GramE>037<span style='mso-spacerun:yes'>&nbsp;
</span>&lt;</span>/body&gt;<o:p></o:p></span></p>

<p class=a style='margin-left:0cm;text-align:justify;text-justify:inter-ideograph;
text-indent:18.0pt;mso-char-indent-count:2.0;background:#E6E6E6'><span
lang=EN-US style='font-size:9.0pt;mso-fareast-font-family:仿宋_GB2312;mso-bidi-font-family:
"Times New Roman"'>#<span class=GramE>038<span style='mso-spacerun:yes'>&nbsp;
</span>&lt;</span>/html&gt;<o:p></o:p></span></p>

<p class=MsoNormal style='text-indent:21.0pt'><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

</div>

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -