<?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对象详解 document 文挡对象 - JavaScript脚本语言描述]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 20 Sep 2007 08:55:25 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	对象属性<br/>document.title &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置文档标题等价于HTML的&lt;title&gt;标签<br/>document.bgColor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置页面背景色<br/>document.fgColor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置前景色(文本颜色)<br/>document.linkColor &nbsp; &nbsp; &nbsp; &nbsp; //未点击过的链接颜色<br/>document.alinkColor &nbsp; &nbsp; &nbsp; &nbsp;//激活链接(焦点在此链接上)的颜色<br/>document.vlinkColor &nbsp; &nbsp; &nbsp; &nbsp;//已点击过的链接颜色<br/>document.URL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置URL属性从而在同一窗口打开另一网页<br/>document.fileCreatedDate &nbsp; //文件建立日期，只读属性<br/>document.fileModifiedDate &nbsp;//文件修改日期，只读属性<br/>document.fileSize &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//文件大小，只读属性<br/>document.cookie &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//设置和读出cookie<br/>document.charset &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置字符集 简体中文:gb2312<br/>---------------------------------------------------------------------<br/>对象方法<br/>document.write() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//动态向页面写入内容<br/>document.createElement(Tag) &nbsp; &nbsp; &nbsp; //创建一个html标签对象<br/>document.getElementById(ID) &nbsp; &nbsp; &nbsp; //获得指定ID值的对象<br/>document.getElementsByName(Name) &nbsp;//获得指定Name值的对象<br/>---------------------------------------------------------------------<br/><br/>images集合(页面中的图象)<br/><br/>a)通过集合引用<br/>document.images &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //对应页面上的&lt;img&gt;标签<br/>document.images.length &nbsp; &nbsp; &nbsp;//对应页面上&lt;img&gt;标签的个数<br/>document.images[0] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//第1个&lt;img&gt;标签 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br/>document.images[i] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//第i-1个&lt;img&gt;标签<br/><br/>b)通过nane属性直接引用<br/>&lt;img name=&quot;oImage&quot;&gt;<br/>document.images.oImage &nbsp; &nbsp; &nbsp;//document.images.name属性<br/><br/>c)引用图片的src属性<br/>document.images.oImage.src &nbsp;//document.images.name属性.src<br/><br/>d)创建一个图象<br/>var oImage<br/>oImage = new Image()<br/>document.images.oImage.src=&quot;/1.jpg&quot;<br/>同时在页面上建立一个&lt;img&gt;标签与之对应就可以显示<br/><br/>&lt;html&gt;<br/>&lt;img name=oImage&gt;<br/>&lt;script language=&quot;javascript&quot;&gt;<br/> &nbsp; var oImage<br/> &nbsp; oImage = new Image()<br/> &nbsp; document.images.oImage.src=&quot;/1.jpg&quot;<br/>&lt;/script&gt;<br/>&lt;/html&gt;<br/><br/>----------------------------------------------------------------------<br/><br/>forms集合(页面中的表单)<br/><br/>a)通过集合引用<br/>document.forms &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //对应页面上的&lt;form&gt;标签<br/>document.forms.length &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//对应页面上&lt;form&gt;标签的个数<br/>document.forms[0] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//第1个&lt;form&gt;标签<br/>document.forms[i] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//第i-1个&lt;form&gt;标签<br/>document.forms[i].length &nbsp; &nbsp; &nbsp; //第i-1个&lt;form&gt;中的控件数<br/>document.forms[i].elements[j] &nbsp;//第i-1个&lt;form&gt;中第j-1个控件<br/><br/>b)通过标签name属性直接引用<br/>&lt;form name=&quot;Myform&quot;&gt;&lt;input name=&quot;myctrl&quot;&gt;&lt;/form&gt;<br/>document.Myform.myctrl &nbsp; &nbsp; &nbsp; &nbsp; //document.表单名.控件名<br/><br/>-----------------------------------------------------------------------<br/>&lt;html&gt;<br/>&lt;!--Text控件相关Script--&gt;<br/>&lt;form name=&quot;Myform&quot;&gt;<br/>&lt;input type=&quot;text&quot; name=&quot;oText&quot;&gt;<br/>&lt;input type=&quot;password&quot; name=&quot;oPswd&quot;&gt;<br/>&lt;form&gt;<br/>&lt;script language=&quot;javascript&quot;&gt;<br/>//获取文本密码框的值<br/>document.write(document.Myform.oText.value)<br/>document.write(document.Myform.oPswd.value)<br/>&lt;/script&gt;<br/>&lt;/html&gt;<br/>-----------------------------------------------------------------------<br/>&lt;html&gt;<br/>&lt;!--Select控件相关Script--&gt;<br/>&lt;form name=&quot;Myform&quot;&gt;<br/>&lt;select name=&quot;oSelect&quot;&gt;<br/>&lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;<br/>&lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;<br/>&lt;option value=&quot;3&quot;&gt;3&lt;/option&gt;<br/>&lt;/select&gt;<br/>&lt;/form&gt;<br/><br/>&lt;script language=&quot;javascript&quot;&gt;<br/> &nbsp; //遍历select控件的option项<br/> &nbsp; var length<br/> &nbsp; length=document.Myform.oSelect.length<br/> &nbsp; for(i=0;i&lt;length;i++)<br/> &nbsp; document.write(document.Myform.oSelect[i].value)<br/>&lt;/script&gt;<br/><br/>&lt;script language=&quot;javascript&quot;&gt;<br/> &nbsp; //遍历option项并且判断某个option是否被选中<br/> &nbsp; for(i=0;i&lt;document.Myform.oSelect.length;i++){<br/> &nbsp; if(document.Myform.oSelect[i].selected!=true)<br/> &nbsp; document.write(document.Myform.oSelect[i].value)<br/> &nbsp; else<br/> &nbsp; document.write(&quot;&lt;font color=red&gt;&quot;+document.Myform.oSelect[i].value+&quot;&lt;/font&gt;&quot;) &nbsp; <br/> &nbsp; }<br/>&lt;/script&gt;<br/><br/>&lt;script language=&quot;javascript&quot;&gt;<br/> &nbsp; //根据SelectedIndex打印出选中的option<br/> &nbsp; //(0到document.Myform.oSelect.length-1)<br/> &nbsp; i=document.Myform.oSelect.selectedIndex<br/> &nbsp; document.write(document.Myform.oSelect[i].value)<br/>&lt;/script&gt;<br/><br/>&lt;script language=&quot;javascript&quot;&gt;<br/> &nbsp; //动态增加select控件的option项<br/> &nbsp; var oOption = document.createElement(&quot;OPTION&quot;);<br/> &nbsp; oOption.text=&quot;4&quot;;<br/> &nbsp; oOption.value=&quot;4&quot;;<br/> &nbsp; document.Myform.oSelect.add(oOption);<br/>&lt;/script&gt;<br/>&lt;html&gt;<br/>-----------------------------------------------------------------------<br/>&lt;Div id=&quot;oDiv&quot;&gt;Text&lt;/Div&gt;<br/>document.all.oDiv &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //引用图层oDiv<br/>document.all.oDiv.style &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br/>document.all.oDiv.style.display=&quot;&quot; &nbsp; &nbsp; &nbsp;//图层设置为可视<br/>document.all.oDiv.style.display=&quot;none&quot; &nbsp;//图层设置为隐藏<br/>/*document.all表示document中所有对象的集合<br/>只有ie支持此属性，因此也用来判断浏览器的种类*/<br/>
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [javascript]document对象详解 document 文挡对象 - JavaScript脚本语言描述]]></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>