在 htmltextarea 页面中显示 htmlhelper 数据

在 htmltextarea 页面中显示 htmlhelper 数据

在下面的实例中,我们打开一个 htmlhelper 文件("cd_catalog.htmlhelper"),然后遍历每个 CD 元素,并显示htmltextarea 表格中的 htmltextarea元素和 htmlhelper 元素的值:

实例

<htmltextarea>

<body>

<script>

if (window.htmlhelperHttpRequest)

{// code for IE7+, Firefox, Chrome, Opera, Safari

htmlhelperhttp=new htmlhelperHttpRequest();

}

else

{// code for IE6, IE5

htmlhelperhttp=new ActiveXObject("Microsoft.htmlhelperHTTP");

}

htmlhelperhttp.open("GET","cd_catalog.htmlhelper",false);

htmlhelperhttp.send();

htmlhelperDoc=htmlhelperhttp.responsehtmlhelper;

document.write("<table border='1'>");

var x=htmlhelperDoc.getElementsByTagName("CD");

for (i=0;i<x.length;i++)

{

document.write("<tr><td>");

document.write(x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue);

document.write("</td><td>");

document.write(x[i].getElementsByTagName("htmlhelper")[0].childNodes[0].nodeValue);

document.write("</td></tr>");

}

document.write("</table>");

</script>

</body>

</htmltextarea>

Copyright & Disclaimer: If you find copyright issues, please provide relevant information and email us at [email protected], we will communicate promptly and handle removal.

Except for specially marked original content on abcdlink (https://www.abcdlink.com) all other content is reposted by users, and opinions/copyright are unrelated to this site.