当前位置:首页> 搜索优化 > 在 htmltextarea 页面中显示 htmlhelper 数据

在 htmltextarea 页面中显示 htmlhelper 数据

2022-06-17 08:54:42 来源: 网络   编辑: 佚名   浏览(299)人   
0

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>

【版权与免责声明】如发现内容存在版权问题,烦请提供相关信息发邮件至 1439028666@qq.com ,我们将及时沟通进行删除处理。 本站内容除了 98link( http://www.98link.com/ )特别标记的原创外,其它均为网友转载内容,涉及言论、版权与本站无关。