我无法让 Javascript 在网站上列出“开始”数字,因为它是空的。
这是我的html正文代码,
<script type="text/javascript">
captionsDoc = loadXMLDoc("captions.xml");
x=captionsDoc.getElementsByTagName('text');
for(i=0;i<x.length;i++)
{
document.write(x[i].getAttribute('start'));
document.write("/n");
}
</script>
那么这是来自 captions.xml 的 xml 代码示例
<transcript>
<text start="6.738" dur="2.277">and explain a few interesting points about them.</text>
<text start="9.016" dur="2.722">But first I need to crush your expectations.</text>
<text start="24.716" dur="1.611">So let's begin.</text>
<text start="26.328" dur="2.535">First we start with the solvent diethyl phthalate.</text></transcript>