建个A.HTML
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml">
把XML里的数据读到HTML中并显示
start();
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("email.xml");
function start()
{
var root=xmlDoc.documentElement;
todata.innerText=root.childNodes.item(0).text;
fromdata.innerText=root.childNodes.item(1).text;
ccdata.innerText=root.childNodes.item(2).text;
subjectdata.innerText=root.childNodes.item(3).text;
bodydata.innerText=root.childNodes.item(4).text;
}
To:
From:
CC:
Subject:
Body:
建个email.xml
Bill_Pardi@hotmail.com
Eric_Schurman@hotmail.com
DHTML_in_Action@hotmail.com
Basic email
This is an XML-based email.
运行a.html,看到了吧,粗体部分为关键
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23109131/viewspace-630722/
,如需转载,请注明出处,否则将追究法律责任。