<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[[JavaScript] document对象详解]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Mon, 03 Sep 2007 01:44:45 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	<br/>注:页面上元素name属性和JavaScript引用的名称必须一致包括大小写<br/><br/>否则会提示你一个错误信息 "引用的元素为空或者不是对象"<br/><br/>---------------------------------------------------------------------<br/><br/>对象属性<br/><br/>document.title //设置文档标题等价于HTML的<title>标签<br/><br/>document.bgColor //设置页面背景色<br/><br/>document.fgColor //设置前景色(文本颜色)<br/><br/>document.linkColor //未点击过的链接颜色<br/><br/>document.alinkColor //激活链接(焦点在此链接上)的颜色<br/><br/>document.vlinkColor //已点击过的链接颜色<br/><br/>document.URL //设置URL属性从而在同一窗口打开另一网页<br/><br/>document.fileCreatedDate //文件建立日期，只读属性<br/><br/>document.fileModifiedDate //文件修改日期，只读属性<br/><br/>document.fileSize //文件大小，只读属性<br/><br/>document.cookie //设置和读出cookie<br/><br/>document.charset //设置字符集 简体中文:gb2312<br/><br/>---------------------------------------------------------------------<br/><br/>对象方法<br/><br/>document.write() //动态向页面写入内容<br/><br/>document.createElement(Tag) //创建一个html标签对象<br/><br/>document.getElementById(ID) //获得指定ID值的对象<br/><br/>document.getElementsByName(Name) //获得指定Name值的对象<br/><br/>---------------------------------------------------------------------<br/><br/>images集合(页面中的图象)<br/><br/>a)通过集合引用<br/><br/>document.images //对应页面上的<img>标签<br/><br/>document.images.length //对应页面上<img>标签的个数<br/><br/>document.images[0] //第1个<img>标签 <br/><br/>document.images[i] //第i-1个<img>标签<br/><br/>b)通过nane属性直接引用<br/><br/><img name="oImage"><br/><br/>document.images.oImage //document.images.name属性<br/><br/>c)引用图片的src属性<br/>document.images.oImage.src //document.images.name属性.src<br/><br/>d)创建一个图象<br/><br/>var oImage<br/><br/>oImage = new Image()<br/><br/>document.images.oImage.src="http://ent.omeweb.com/1.jpg同时在页面上建立一个<img>标签与之对应就可以显示<br/><br/><html><br/><br/><img name=oImage><br/><br/><script language="javascript"><br/><br/>var oImage<br/><br/>oImage = new Image()<br/><br/>document.images.oImage.src="http://ent.omeweb.com/1.jpg</script><br/><br/></html><br/><br/>---------------------------------------------------------------------<br/><br/>forms集合(页面中的表单)<br/><br/>a)通过集合引用<br/><br/>document.forms //对应页面上的<form>标签<br/><br/>document.forms.length //对应页面上<form>标签的个数<br/><br/>document.forms[0] //第1个<form>标签<br/><br/>document.forms[i] //第i-1个<form>标签<br/><br/>document.forms[i].length //第i-1个<form>中的控件数<br/><br/>document.forms[i].elements[j] //第i-1个<form>中第j-1个控件<br/><br/>b)通过标签name属性直接引用<br/><br/><form name="Myform"><input name="myctrl"></form><br/><br/>document.Myform.myctrl //document.表单名.控件名<br/><br/>---------------------------------------------------------------------<br/><br/><html><br/><br/><!--Text控件相关Script--><br/><br/><form name="Myform"><br/><br/><input type="text" name="oText"><br/><br/><input type="password" name="oPswd"><br/><br/><form><br/><br/><script language="javascript"><br/><br/>//获取文本密码框的值<br/><br/>document.write(document.Myform.oText.value)<br/><br/>document.write(document.Myform.oPswd.value)<br/><br/></script><br/><br/></html><br/><br/><html><br/><br/><!--Select控件相关Script--><br/><br/><form name="Myform"><br/><br/><select name="oSelect"><br/><br/><option value="1">1</option><br/><br/><option value="2">2</option><br/><br/><option value="3">3</option><br/><br/></select><br/><br/></form><br/><br/><script language="javascript"><br/><br/>//遍历select控件的option项<br/><br/>var length<br/><br/>length=document.Myform.oSelect.length<br/><br/>for(i=0;i<length;i++)<br/><br/>document.write(document.Myform.oSelect[i].value)<br/><br/></script><br/><br/><script language="javascript"><br/><br/>//遍历option项并且判断某个option是否被选中<br/><br/>for(i=0;i<document.Myform.oSelect.length;i++)&#123;<br/><br/>if(document.Myform.oSelect[i].selected!=true)<br/><br/>document.write(document.Myform.oSelect[i].value)<br/><br/>else<br/><br/>document.write("<font color=red>"+document.Myform.oSelect[i].value+"</font>") <br/><br/>&#125;<br/><br/></script><br/><br/><script language="javascript"><br/><br/>//根据SelectedIndex打印出选中的option<br/><br/>//(0到document.Myform.oSelect.length-1)<br/><br/>i=document.Myform.oSelect.selectedIndex<br/><br/>document.write(document.Myform.oSelect[i].value)<br/><br/></script><br/><br/><script language="javascript"><br/><br/>//动态增加select控件的option项<br/><br/>var oOption = document.createElement("OPTION");<br/><br/>oOption.text="4";<br/><br/>oOption.value="4";<br/><br/>document.Myform.oSelect.add(oOption);<br/><br/></script><br/><br/><html><br/><br/>---------------------------------------------------------------------<br/><br/><Div id="oDiv">Text</Div><br/><br/>document.all.oDiv //引用图层oDiv<br/><br/>document.all.oDiv.style <br/><br/>document.all.oDiv.style.display="" //图层设置为可视<br/><br/>document.all.oDiv.style.display="none" //图层设置为隐藏<br/><br/>/*document.all表示document中所有对象的集合<br/><br/>只有ie支持此属性，因此也用来判断浏览器的种类*/<br/><br/>---------------------------------------------------------------------<br/><br/>在IE地址栏里面输入： <br/><br/>javascript:alert(document.documentElement.outerHTML)查看源文件<br/>
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [JavaScript] document对象详解]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>