<html>
<head>
<title>第八章 充实文档内容 </title>
</head>
<body>
<h1>what is Document Object Model</h1>
<p>the <abbr title="Word wide web Consortium">W3C </abbr>defines the <abbr title="Document Object Model">DoM </abbr>as:</p>
<blockquote cite="http://www.w3.org/DOM/">
<P>A platform-and language-neutral interface tha will allow programs and script to dynamically access and update the content,structure and style of documents.
</P>
</blockquote>
<p>It is an<abbr title="Application Programming Interface">API</abbr>tha can be used to navigate <abbr title="HyperText Markup Language">HTML</abbr>and <abbr title="eXtensible Markup Language">XML</abbr>documents.
</p>
<ul>
<li><a href="index.html" accesskey="1">Home</a></li>
<li><a href="searh.html" accesskey="4">Search</a></li>
<li><a href="contact.html" accesskey="9">Contact</a></li>
</ul>
</body>
<script type="text/javascript">
function addLoadEvent(func){
var oldonload =window.onload;
if(typeof window.onload!="function"){
window.onload=func;
}else{
window.onload=function(){
oldonload();
func();
}
}
}
function displayAbbreviations(){
if(!document.getElementsByTagName||
!document.createElement||
!document.createTextNode)return false;
var abbreviations=document.getElementsByTagName("abbr");
if (abbreviations.length<1)return false;
var defs=new Array();
for (var i = 0; i < abbreviations.length; i++) {
var current_abbr=abbreviations[i];
var definition=current_abbr.getAttribute("title");
var key=current_abbr.lastChild.nodeValue;
defs[key]=definition;
}
var dlist=document.createElement("dl");
for(key in defs){
var definition=defs[key];
var dtitle=document.createElement("dt");
var dtitle_text=document.createTextNode(key);
dtitle.appendChild(dtitle_text);
var ddesc=document.createElement("dd");
var ddesc_text=document.createTextNode(definition);
ddesc.appendChild(ddesc_text);
dlist.appendChild(dtitle);
dlist.appendChild(ddesc);
}
if(dlist.childNodes.length<1)return false;
var header=document.createElement("h2");
var header_text=document.createTextNode("Abbreviations")
header.appendChild(header_text);
document.body.appendChild(header);
document.body.appendChild(dlist);
}
function displayCitations(){
if(!document.getElementsByTagName||
!document.createElement||
!document.createTextNode)return false ;
var quotes=document.getElementsByTagName("blockquote");
for (var i = 0; i < quotes.length; i++) {
if(!quotes[i].getAttribute("cite"))continue;
var url=quotes[i].getAttribute("cite");
var qutoeChildren=quotes[i].getElementsByTagName('*');
if(qutoeChildren.length<1)continue;
var elem=qutoeChildren[qutoeChildren.length-1];
var link=document.createElement("a");
var link_text=document.createTextNode("source");
link.appendChild(link_text);
link.setAttribute("href",url);
var superscript=document.createElement("sup");
superscript.appendChild(link);
elem.appendChild(superscript);
};
}
function displayAcceskeys(){
if(!document.getElementsByTagName||
!document.createElement||
!document.createTextNode)return false;
var links=document.getElementsByTagName("a");
var akeys=new Array();
for (var i = 0; i < links.length; i++) {
var current_link=links[i];
if (!current_link.getAttribute("accesskey"))continue;
var key=current_link.getAttribute("accesskey");
var text=current_link.lastChild.nodeValue;
akeys[key]=text;
}
var list=document.createElement("ul");
for(key in akeys){
var text=akeys[key];
var str=key+":"+text;
var item=document.createElement("li");
var item_text=document.createTextNode(str);
item.appendChild(item_text);
list.appendChild(item);
}
var header=document.createElement("h3")
var header_text=document.createTextNode("Accesskeys")
header.appendChild(header_text)
document.body.appendChild(header);
document.body.appendChild(list);
}
addLoadEvent(displayAbbreviations);
addLoadEvent(displayCitations);
addLoadEvent(displayAcceskeys);
</script>
</html>