??xml version="1.0" encoding="utf-8" standalone="yes"?>中国亚洲呦女专区,午夜在线亚洲男人午在线,亚洲大尺码专区影院http://www.tkk7.com/rodney/category/2856.htmlzh-cnWed, 28 Feb 2007 08:10:38 GMTWed, 28 Feb 2007 08:10:38 GMT60JBuilder2006中的illegal character \12288错误http://www.tkk7.com/rodney/archive/2006/04/21/42264.htmlrodneyrodneyFri, 21 Apr 2006 01:37:00 GMThttp://www.tkk7.com/rodney/archive/2006/04/21/42264.htmlhttp://www.tkk7.com/rodney/comments/42264.htmlhttp://www.tkk7.com/rodney/archive/2006/04/21/42264.html#Feedback0http://www.tkk7.com/rodney/comments/commentRss/42264.htmlhttp://www.tkk7.com/rodney/services/trackbacks/42264.html我用C本打开一个以前的分页E序。把其中的一部䆾代码copy到我的现在的E序中,可是~译器提Cillegal character \12288错误。我按它提示的错误找到发生错误的行。我用别的变量名试了一下是可以的。难道是q个变量名输入时用了中文的输入法。我check一下,可是q是没有解决。我又重新声明了一个与q个变量名一L变量Q把原来的注释v来。后来发现可以了Q我再把现在的注释掉Q用原来的变量,q是不行。我把它删除掉重新写了一遍包括空g删除。OKQ就可以了。我惛_能还是有中文的输入字W或是空根{?br />

以面的问题可真是不是问题的问题,如果遇到同样的问题的朋友看看是否也是犯了同样的错?br />
最后发现是一个中文的I格Q我在删除该变量时发现有一个空格的距离较大?/p>

rodney 2006-04-21 09:37 发表评论
]]>
?lt;form action="">中的action写要执行q个表单的是哪个文g时出的错误?/title><link>http://www.tkk7.com/rodney/archive/2006/04/17/41477.html</link><dc:creator>rodney</dc:creator><author>rodney</author><pubDate>Mon, 17 Apr 2006 09:01:00 GMT</pubDate><guid>http://www.tkk7.com/rodney/archive/2006/04/17/41477.html</guid><wfw:comment>http://www.tkk7.com/rodney/comments/41477.html</wfw:comment><comments>http://www.tkk7.com/rodney/archive/2006/04/17/41477.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/rodney/comments/commentRss/41477.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/rodney/services/trackbacks/41477.html</trackback:ping><description><![CDATA[ <p> <b> <font style="BACKGROUND-COLOR: #525d76" color="#ffffff">type</font> </b> Status report</p> <p> <b> <font style="BACKGROUND-COLOR: #525d76" color="#ffffff">message</font> </b> <u>/zz3in1/SrvTest</u> </p> <p> <b> <font style="BACKGROUND-COLOR: #525d76" color="#ffffff">description</font> </b> <u>The requested resource (/zz3in1/SrvTest) is not available.<br /></u>q是Z呢?<br />用过?./../SrvTest q个是不行的?/./SrvTestq样可以。还?/SrvTest也可以?br /></p> <img src ="http://www.tkk7.com/rodney/aggbug/41477.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/rodney/" target="_blank">rodney</a> 2006-04-17 17:01 <a href="http://www.tkk7.com/rodney/archive/2006/04/17/41477.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>取表g的单元格的数?/title><link>http://www.tkk7.com/rodney/archive/2006/04/14/41069.html</link><dc:creator>rodney</dc:creator><author>rodney</author><pubDate>Fri, 14 Apr 2006 04:49:00 GMT</pubDate><guid>http://www.tkk7.com/rodney/archive/2006/04/14/41069.html</guid><wfw:comment>http://www.tkk7.com/rodney/comments/41069.html</wfw:comment><comments>http://www.tkk7.com/rodney/archive/2006/04/14/41069.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/rodney/comments/commentRss/41069.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/rodney/services/trackbacks/41069.html</trackback:ping><description><![CDATA[用document.getElementById("01").innerHTML/innerText都可以。如Q?lt;tr><td id="01">Hello</td></tr>要把Hello取出来就可以用document.getElementById("01").innerHTML/innerText?br />但是用innerHTML与用innerText有什么区别吗Q用innerHTML会把q个标记中的所有HTML标记与值取出来。innerText只会取最后的倹{?img src ="http://www.tkk7.com/rodney/aggbug/41069.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/rodney/" target="_blank">rodney</a> 2006-04-14 12:49 <a href="http://www.tkk7.com/rodney/archive/2006/04/14/41069.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>document对象详解http://www.tkk7.com/rodney/archive/2006/04/10/40231.htmlrodneyrodneyMon, 10 Apr 2006 06:07:00 GMThttp://www.tkk7.com/rodney/archive/2006/04/10/40231.htmlhttp://www.tkk7.com/rodney/comments/40231.htmlhttp://www.tkk7.com/rodney/archive/2006/04/10/40231.html#Feedback0http://www.tkk7.com/rodney/comments/commentRss/40231.htmlhttp://www.tkk7.com/rodney/services/trackbacks/40231.html 以下信息是{?a >http://www.aaunion.net/cn/blog/more.asp?name=magicmao&id=687
document
文挡对象 - JavaScript脚本语言描述

---------------------------------------------------------------------

?span lang="EN-US">:面上元?span lang="EN-US">name属性和JavaScript引用的名U必M致包括大写

   否则会提CZ一个错误信?span lang="EN-US"> "引用的元素ؓI或者不是对?span lang="EN-US">"

---------------------------------------------------------------------

 

对象属?span lang="EN-US">

document.title             // 讄文标题{h(hun)?span lang="EN-US">HTML?span lang="EN-US"><title>标签

document.bgColor           // 讄面背景?span lang="EN-US">

document.fgColor           // 讄前景?span lang="EN-US">(文本颜色)

document.linkColor         // 未点击过的链接颜?span lang="EN-US">

document.alinkColor        // Ȁz链?span lang="EN-US">(焦点在此链接?span lang="EN-US">)的颜?span lang="EN-US">

document.vlinkColor        // 已点击过的链接颜?span lang="EN-US">

document.URL               // URL属性从而在同一H口打开另一|页

document.fileCreatedDate   // 文g建立日期Q只d?span lang="EN-US">

document.fileModifiedDate  // 文g修改日期Q只d?span lang="EN-US">

document.fileSize          // 文g大小Q只d?span lang="EN-US">

document.cookie            // 讄和读?span lang="EN-US">cookie

document.charset           // 讄字符?体中?span lang="EN-US">:gb2312

---------------------------------------------------------------------

对象Ҏ(gu)

document.write()                  // 动态向面写入内容

document.createElement(Tag)       // 创徏一?span lang="EN-US">html标签对象

document.getElementById(ID)       // 获得指定ID值的对象

document.getElementsByName(Name)  // 获得指定Name值的对象

---------------------------------------------------------------------

 

images 集合(面中的图象)

 

a) 通过集合引用

document.images             // 对应面上的<img>标签

document.images.length      // 对应面?span lang="EN-US"><img>标签的个?span lang="EN-US">

document.images[0]          // W?span lang="EN-US">1?span lang="EN-US"><img>标签

document.images[i]          // W?span lang="EN-US">i-1?span lang="EN-US"><img>标签

 

b) 通过nane属性直接引?span lang="EN-US">

<img name="oImage">

document.images.oImage      //document.images.name 属?span lang="EN-US">

 

c) 引用囄?span lang="EN-US">src属?span lang="EN-US">

document.images.oImage.src  //document.images.name 属?span lang="EN-US">.src

 

d) 创徏一个图?span lang="EN-US">

var oImage

oImage = new Image()

document.images.oImage.src="/1.jpg"

// 同时在页面上建立一?span lang="EN-US"><img>标签与之对应可以显C?span lang="EN-US">

 

<html>

<img name=oImage>

<script language="javascript">

   var oImage

   oImage = new Image()

   document.images.oImage.src="/1.jpg"

</script>

</html>

 

----------------------------------------------------------------------

 

forms 集合(面中的表单)

 

a) 通过集合引用

document.forms                 // 对应面上的<form>标签

document.forms.length          // 对应面?span lang="EN-US"><form>标签的个?span lang="EN-US">

document.forms[0]              // W?span lang="EN-US">1?span lang="EN-US"><form>标签

document.forms[i]              // W?span lang="EN-US">i-1?span lang="EN-US"><form>标签

document.forms[i].length       // W?span lang="EN-US">i-1?span lang="EN-US"><form>中的控g?span lang="EN-US">

document.forms[i].elements[j]  // W?span lang="EN-US">i-1?span lang="EN-US"><form>中第j-1个控?span lang="EN-US">

 

b) 通过标签name属性直接引?span lang="EN-US">

<form name="Myform"><input name="myctrl"></form>

document.Myform.myctrl         //document. 表单?span lang="EN-US">.控g?span lang="EN-US">

 

-----------------------------------------------------------------------

<html>

<!--Text 控g相关Script-->

<form name="Myform">

<input type="text" name="oText">

<input type="password" name="oPswd">

<form>

<script language="javascript">

// 获取文本密码框的?span lang="EN-US">

document.write(document.Myform.oText.value)

document.write(document.Myform.oPswd.value)

</script>

</html>

-----------------------------------------------------------------------

<html>

<!--Select 控g相关Script-->

<form name="Myform">

<select name="oSelect">

<option value="1">1</option>

<option value="2">2</option>

<option value="3">3</option>

</select>

</form>

 

<script language="javascript">

   // 遍历select控g?span lang="EN-US">option?span lang="EN-US">

   var length

   length=document.Myform.oSelect.length

   for(i=0;i<length;i++)

   document.write(document.Myform.oSelect[i].value)

</script>

 

<script language="javascript">

   // 遍历optionƈ且判断某?span lang="EN-US">option是否被选中

   for(i=0;i<document.Myform.oSelect.length;i++){

   if(document.Myform.oSelect[i].selected!=true)

    document.write(document.Myform.oSelect[i].value)

   else

   document.write("<font color=red>"+document.Myform.oSelect[i].value+"</font>")  

   }

</script>

 

<script language="javascript">

   // Ҏ(gu)SelectedIndex打印出选中?span lang="EN-US">option

   //(0 ?span lang="EN-US">document.Myform.oSelect.length-1)

   i=document.Myform.oSelect.selectedIndex

   document.write(document.Myform.oSelect[i].value)

</script>

 

<script language="javascript">

   // 动态增?span lang="EN-US">select控g?span lang="EN-US">option?span lang="EN-US">

   var oOption = document.createElement("OPTION");

   oOption.text="4";

   oOption.value="4";

   document.Myform.oSelect.add(oOption);

</script>

<html>

-----------------------------------------------------------------------

<Div id="oDiv">Text</Div>

document.all.oDiv                       // 引用囑ֱoDiv

document.all.oDiv.style                

document.all.oDiv.style.display=""      // 囑ֱ讄为可?span lang="EN-US">

document.all.oDiv.style.display="none"  // 囑ֱ讄为隐?span lang="EN-US">

/*document.all 表示document中所有对象的集合

只有ie支持此属性,因此也用来判断浏览器的种c?span lang="EN-US">*/

-----------------------------------------------------------------------



rodney 2006-04-10 14:07 发表评论
]]>
JAVAQWebsphere,DB2,Oracle, JBuilder2006,开发工P|络工具Q教学工P商务软g想下׃http://www.tkk7.com/rodney/archive/2006/02/15/30744.htmlrodneyrodneyWed, 15 Feb 2006 01:46:00 GMThttp://www.tkk7.com/rodney/archive/2006/02/15/30744.htmlhttp://www.tkk7.com/rodney/comments/30744.htmlhttp://www.tkk7.com/rodney/archive/2006/02/15/30744.html#Feedback0http://www.tkk7.com/rodney/comments/commentRss/30744.htmlhttp://www.tkk7.com/rodney/services/trackbacks/30744.htmlhttp://www.9iv.com/down/index.htm?eid=236712q里有你惌的一切工兯YӞ开发工P商务软g。一切的软g在http://www.9iv.com/down/index.htm?eid=236712中?img src ="http://www.tkk7.com/rodney/aggbug/30744.html" width = "1" height = "1" />

rodney 2006-02-15 09:46 发表评论
]]>
学习JAVAQWeblogic,IBM Webspherepd产品的好dhttp://www.tkk7.com/rodney/archive/2005/12/21/24900.htmlrodneyrodneyWed, 21 Dec 2005 01:09:00 GMThttp://www.tkk7.com/rodney/archive/2005/12/21/24900.htmlhttp://www.tkk7.com/rodney/comments/24900.htmlhttp://www.tkk7.com/rodney/archive/2005/12/21/24900.html#Feedback0http://www.tkk7.com/rodney/comments/commentRss/24900.htmlhttp://www.tkk7.com/rodney/services/trackbacks/24900.html

rodney 2005-12-21 09:09 发表评论
]]>
JAVA中的VECTOR转换成javaScript的数l?/title><link>http://www.tkk7.com/rodney/archive/2005/11/22/20909.html</link><dc:creator>rodney</dc:creator><author>rodney</author><pubDate>Tue, 22 Nov 2005 03:11:00 GMT</pubDate><guid>http://www.tkk7.com/rodney/archive/2005/11/22/20909.html</guid><wfw:comment>http://www.tkk7.com/rodney/comments/20909.html</wfw:comment><comments>http://www.tkk7.com/rodney/archive/2005/11/22/20909.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/rodney/comments/commentRss/20909.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/rodney/services/trackbacks/20909.html</trackback:ping><description><![CDATA[把java中的Vector,Hashtable,List{数cd转换成javaScript的数l。在q里用到的是一个StringBuffer.具体的实现看下面的代码:<BR>public String getArray(Vector v){<BR>  if (v == null || v.size()==0){<BR>   return "";<BR>  }<BR>  int i=0;<BR>  Hashtable hash = null;<BR>  StringBuffer sb = new StringBuffer("var arrmake = new Array(");<BR>  try{<BR>   for(i=0; i<v.size(); i++){<BR>    hash = (Hashtable)v.elementAt(i);<BR>    String tmp_make = hash.get("code").toString();    <BR>    if(i=1){<BR>     sb.append("'"+tmp_make+"'");     <BR>    }else if(i>1){<BR>     sb.append("'"+tmp_make+"',");<BR>    }    <BR>   }<BR>   String test = sb.toString(); <BR>   if (i>1){<BR>    test = test.substring(0,test.length()-1);<BR>   }<BR>   sb.append(test+");");<BR>  }catch(Exception e){<BR>   e.printStackTrace();<BR>  }  <BR>  return sb.toString();<BR> }<BR>要注意这里一定要用try{}catch(){}因ؓ在{换过E中可能会出错,所以用try{}catch(){}把异常抛出?BR>在javascript中怎么用这个数l呢Q?BR>String arrMake = getArray(vecMake);<BR><script language="javaScript"><BR> <%=arrMake%><BR></script><BR>OK.<img src ="http://www.tkk7.com/rodney/aggbug/20909.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/rodney/" target="_blank">rodney</a> 2005-11-22 11:11 <a href="http://www.tkk7.com/rodney/archive/2005/11/22/20909.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>数据cd转换错误http://www.tkk7.com/rodney/archive/2005/11/11/19254.htmlrodneyrodneyFri, 11 Nov 2005 01:42:00 GMThttp://www.tkk7.com/rodney/archive/2005/11/11/19254.htmlhttp://www.tkk7.com/rodney/comments/19254.htmlhttp://www.tkk7.com/rodney/archive/2005/11/11/19254.html#Feedback0http://www.tkk7.com/rodney/comments/commentRss/19254.htmlhttp://www.tkk7.com/rodney/services/trackbacks/19254.htmljava.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
java.lang.Integer.parseInt(Integer.java:489)
以上的错误是因ؓ一个空D强制转换成int型。ؓ什么会是一个空值呢Q是因ؓ在JSP中form的TEXT没有输入g到servlet中。servlet是用Integer.parseInt(request.getParameter("vehFrom"))来取JSP中的?的。要解决q个问题很简单,可是初学者常会遇到这L问题。废话少说还是说怎么解决了的吧?BR>只要在servlet中将q个值做一个空值处理?BR>if((jcf.retuPara(request,"vehFrom")).length()<=0){
      vehFromNo = 0;
     }else{
      vehFromNo = Integer.parseInt(jcf.retuPara(request,"vehFrom"));
     }
要注意一Ҏ(gu)JSP传到servlet中如果没有输入值是NULL倹{我q里用了一个自己写的retuParaQ)Ҏ(gu)是处理NULL的。把NULL处理成“”?BR>好了Q搞定?BR>

rodney 2005-11-11 09:42 发表评论
]]>
挣钱挣QB挣Q币技?/title><link>http://www.tkk7.com/rodney/archive/2005/11/04/18194.html</link><dc:creator>rodney</dc:creator><author>rodney</author><pubDate>Fri, 04 Nov 2005 13:15:00 GMT</pubDate><guid>http://www.tkk7.com/rodney/archive/2005/11/04/18194.html</guid><wfw:comment>http://www.tkk7.com/rodney/comments/18194.html</wfw:comment><comments>http://www.tkk7.com/rodney/archive/2005/11/04/18194.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.tkk7.com/rodney/comments/commentRss/18194.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/rodney/services/trackbacks/18194.html</trackback:ping><description><![CDATA[&lt;P&gt;&lt;A href=&quot;http://www.8qu.net/register.asp?net=rodneyluo&quot;&gt;http://www.8qu.net/register.asp?net=rodneyluo&lt;/A&gt;&lt;BR&gt;我也是在论坛上看了别人的帖子才注册的Q我已经实践q了Q换?0个Q币,真的很好用,向大家推荐!Q!Q?&lt;/P&gt; &lt;P&gt;以前你也可能看过q样的广告,q次你真的不要再错过了!Q?&lt;BR&gt;其实和很多h一P我对|络赚钱由最初的抵触Q因为大安说那是骗人的Q到半信半疑Q因为有朋友说网?amp;lt;/P&gt; &lt;P&gt;行的Q但要看是什么样的网赚)再到信Q因为此时自׃w赚CQ其他的不知道,但通宝实是真的)?&lt;/P&gt; &lt;P&gt;下面介绍一下方法:只要?&lt;A href=&quot;http://www.8qu.net/register.asp?net=rodneyluo&quot;&gt;http://www.8qu.net/register.asp?net=rodneyluo&lt;/A&gt;Q那里有更加详细的介l)?amp;lt;/P&gt; &lt;P&gt;册后,免费下蝲一个YӞ“通宝 ”(tongbao.exeQ?。下载后打开Q点几Z登录?-“开始分”,q样?amp;lt;/P&gt; &lt;P&gt;开始赚Q币了 Q挂机就可以赚Q币了,跟挂QQ差不多?&lt;BR&gt;?分钟自动增加一U分 ?&lt;/P&gt; &lt;P&gt;别看到要写银行帐号就吓到了,其实你可以不填(填一下,因ؓ当你辑ֈ支付的条件时可以确时时的&lt;/P&gt; &lt;P&gt;收到人民币)Q选择要Q币(只需要输入QQLQ?&lt;/P&gt; &lt;P&gt;注册地址Q?amp;lt;A href=&quot;http://www.8qu.net/register.asp?net=rodneyluo&quot;&gt;http://www.8qu.net/register.asp?net=rodneyluo&lt;/A&gt;&lt;/P&gt; &lt;P&gt;推荐使用八趣TongBao的理? &lt;/P&gt; &lt;P&gt;一. 无需M点击.泡时间积?像|易POPO一?对工作没有Q何媄?不象NewsbarQ新L报)或SABar{?amp;lt;/P&gt; &lt;P&gt;要及时保存积? &lt;BR&gt;二.真正的无q扰.隐藏时只在Q务栏中有一个小“铜钱”,只占1M内存,对于动辄256Q?12甚至上G内存的机?amp;lt;/P&gt; &lt;P&gt;说根本就?ji)牛一毛,对你上网q其他事没有q扰?&lt;BR&gt;? l色Y件无需安装. &lt;BR&gt;? 无需一分钱投入.免费注册使用,因而没有Q何风险(要自己投资钱的话我是肯定不会d的)Q?而且信誉&lt;/P&gt; &lt;P&gt;l对没问题,要有问题也不可能存在q么多年。我的亲w经历就?&lt;BR&gt;五.下线CU分兑现?TongBao支持五下线Q?0%Q?%Q?%Q?%Q?%?&lt;BR&gt;按每月推?0名下U,你的下线每月又推?0名下U,以公司承诺每1000个积分最低付?元计(实际会超q?amp;lt;/P&gt; &lt;P&gt;5元)Q你的月收入分别为(按每人每?000个积分计)Q?&lt;BR&gt;W?个月收入Q?5元; &lt;BR&gt;W?个月收入Q?5 +5 =10?&lt;BR&gt;W?个月收入Q?5 +5 +25 =35元; &lt;BR&gt;W?个月收入Q?5 +5 +25 +150 =185元; &lt;BR&gt;W?个月收入Q?5 +5 +25 +150 +1500 =1685元; &lt;BR&gt;W?个月收入Q? +5 +25 +150 +1500 +15000 =16685元; &lt;BR&gt;说实话,其实q是理想的算法,实际上是很难辑ֈ的,因ؓ不能保证每个人都认真L分和发展下线 Q但是你&lt;/P&gt; &lt;P&gt;认真点去做的话,几个月以后每个月赚几癄Ҏ(gu)问题Q而且q将E_增长的,q已l相当不错了Q至我?amp;lt;/P&gt; &lt;P&gt;得是q样Q!Q?&lt;/P&gt; &lt;P&gt;当然,如果单独一个h只是挂机Q一天只l挂四小ӞQ一个月也就7元,但这?元比Newsbar和SABar一个月?amp;lt;/P&gt; &lt;P&gt;7元容易赚多了,不需M点击。如果有下线Q收入见上面式。要是三个一h更加不用说了?&lt;/P&gt; &lt;P&gt;八趣TongBao免费注册Q?&lt;A href=&quot;http://www.8qu.net/register.asp?net=rodneyluo&quot;&gt;http://www.8qu.net/register.asp?net=rodneyluo&lt;/A&gt;强烈推荐) &lt;BR&gt;  &lt;BR&gt;我的使用心得。如果不是网虫,一定得惛_法发展十来个下线Q最单的Ҏ(gu)是到论坛发_关键是这东西&lt;/P&gt; &lt;P&gt;可以赚QBQ有很多人愿意挂的。我现在已经发展?31个下U了。还有一点,我们从下UK里提成,但下U自?amp;lt;/P&gt; &lt;P&gt;的点数是不会变的。所以越多h加进来,你会多的收益,q不会媄响他们。到以后Q自׃|时记得挂Q?amp;lt;/P&gt; &lt;P&gt;不记得就了。如果下U多Q有一天可能收?00元或1000元,也可以补贴一下上|费Q不能太费宽带吧,?amp;lt;/P&gt; &lt;P&gt;收获当做一U意外不是很好吗Q! &lt;/P&gt; &lt;P&gt;关键的关键,没事多来发发_多拉点h成你的下U,靠自己泡效果不明显Q一个月?0来个QB。如果下U?amp;lt;/P&gt; &lt;P&gt;多了Q自己都不用挂,吃提成都够了。大家一h挂吧Q就跟挂QQ似的Q全民一hQ我靠,最后加入的也有1&lt;/P&gt; &lt;P&gt;0块一个月Q那些下U多的真得会发死哎~~呵呵。注册八?amp;lt;A href=&quot;http://www.8qu.net/register.asp?net=iamcacy&quot;&gt;http://www.8qu.net/register.asp?net=iamcacy&lt;/A&gt;?amp;lt;/P&gt; &lt;P&gt;赚钱Q我受益Q挂在网上不费事Q月入一千也是你Q还{什么快快成为第一Ҏ(gu)册者,让更多的人成Z的下&lt;/P&gt; &lt;P&gt;U!具体介绍误?amp;lt;A href=&quot;http://www.8qu.net/register.asp?net=iamcacy&quot;&gt;http://www.8qu.net/register.asp?net=iamcacy&lt;/A&gt;如有疑问请加379588056听我在线询问Q?amp;lt;/P&gt; &lt;P&gt;决不骗你Q?&lt;/P&gt; &lt;P&gt;q有是量dB(ti)TU子发展下线Q象我一PZ人服务的同时q行宣传Q效果很好!Q! &lt;BR&gt;双管齐下q愁发展不了下线Q哈哈,到时坐着{钱拉, &lt;/P&gt; &lt;P&gt;持之以恒Q相信收L一天很快到来!Q(Ҏ(gu)有恒心,急功q利的不推荐使用Q因要几个月才能看?amp;lt;/P&gt; &lt;P&gt;非常明显的效果) &lt;BR&gt;我徏有一个群Q交用心得和解答疑难Q?653115Q想加的在验证的时候写上:通宝用户 &lt;BR&gt;有疑惑的也可以加q来再详l咨询?amp;lt;/P&gt;<img src ="http://www.tkk7.com/rodney/aggbug/18194.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/rodney/" target="_blank">rodney</a> 2005-11-04 21:15 <a href="http://www.tkk7.com/rodney/archive/2005/11/04/18194.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DOM定义Ҏ(gu)作一个文对象的节点l构提供了实用的Ҏ(gu)http://www.tkk7.com/rodney/archive/2005/09/19/13392.htmlrodneyrodneyMon, 19 Sep 2005 05:28:00 GMThttp://www.tkk7.com/rodney/archive/2005/09/19/13392.htmlhttp://www.tkk7.com/rodney/comments/13392.htmlhttp://www.tkk7.com/rodney/archive/2005/09/19/13392.html#Feedback0http://www.tkk7.com/rodney/comments/commentRss/13392.htmlhttp://www.tkk7.com/rodney/services/trackbacks/13392.html
replaceChild()--在childNodes集合U用指定的newChild来代替oldChild;如果代替成功,则返回oldChild;如果newChild是null,则只需删除oldChild卛_?BR>
removeChild()--从节点的ChildNodes集合中删除removeChild指定的节?如果删除成功,则返回删除的子节炏V?BR>
appendChild()--d一个新节点到childNodes集合的末?如果成功,则返回新节点?BR>
cloneNode()--创徏一个新的、复制的节点,q且如果传入的参数是true?q将复制子节?如果节点是一个元?那么q将复制相应属?q回新的节点?BR>
Z在一|档树中访问或者徏立一个新的节?可以用下面这些方?
getElementById()
getElementsByTagName()
createElement()
createAttribute()
createTextNode()
注意:在一个页面中只有一个文对?除了getElementsByTagName()?其它Ҏ(gu)均只能通过document.methodName()调用?BR>再看一下下面这个例?
<html>
<head>
<title></title>
</head>
<body>
<p>This is a sample paragraph.</p>
<SCRIPT LANGUAGE="JavaScript">
<!--
alert(document.documentElement.lastChild.firstChild.tagName);
//-->
</SCRIPT>
</body>
</html>
l果会昄"P",下面是一些解?BR>document.documentElement - gives the page's HTML tag.
lastChild - gives the BODY tag.
firstChild - gives the first element in the BODY.
tagName - gives that element's tag name, "P" in this case.
另一?
<html>
<head>
<title></title>
</head>
<body>

<p>This is a sample paragraph.</p>
<SCRIPT LANGUAGE="JavaScript">
<!--
alert(document.documentElement.lastChild.firstChild.tagName);
//-->
</SCRIPT>
</body>
</html>
q个例子和上面ƈ没有什么大的区?仅仅是多了一个空?但是在NS?会自动ؓI加上一个节Ҏ(gu)以返回值是"undefined",而在IE中将跌I仍然指向P标签?BR>
更常用的Ҏ(gu):
<p id="myParagraph">This is a sample paragraph.</p>
...
alert(document.getElementById("myParagraph").tagName);
q种Ҏ(gu)你不用关心节点在文树的哪一个地?而只要保证在面中它的IDh唯一的就可以了?BR>
接下来一U访问元素节点的Ҏ(gu)是document.getElementsByTagName(),它的q回值是一个数l?例如你可以通过下面的例子改变整个页面的q接Q?BR>var nodeList = document.getElementsByTagName("A");
for (var i = 0; i < nodeList.length; i++)
nodeList[i].style.color = "#ff0000";

attribute和attributes
attribute对象和元素相?但是却没有被认ؓ是文档树的一部分,因此属性不能作为子节点集合的一部分来用?BR>有三U方法可以ؓ元素建立新的属?BR>1.
var attr = document.createAttribute("myAttribute");
attr.value = "myValue";
var el = document.getElementById("myParagraph");
el.setAttributeNode(attr);
2.
var el = document.getElementById("myParagraph");
el.setAttribute("myAttribute", "myValue");
3.
var el = document.getElementById("myParagraph");
el.myAttribute = "myValue";
你可以在html标签U定义自q属?
<p id="myParagraph" myAttribute="myValue">This is a sample paragraph.</p>
...
alert(document.getElementById("myParagraph").getAttribute("myAttribute"));
q回值将?myValue".但是h意这里必M用getAttribute,而不是AttributeName,因ؓ有一些浏览器q不支持自定义属性?BR>
attributes也可以被L的从一个元素中删除,你可以用removeAttribute()或者将element.attributeName指向一个null倹{?BR>通过attributes我们可以生一些动态效果:
<p id="sample1" align="left">Text in a paragraph element.</p>
... code for the links ...
document.getElementById('sample1').setAttribute('align', 'left');
document.getElementById('sample1').setAttribute('align', 'right');
另一U?
<p id="sample2" style="text-align:left;">Text in a paragraph
element.</p>
... code for the links ...
document.getElementById('sample2').style.textAlign = 'left';
document.getElementById('sample2').style.textAlign = 'right';
跟上面的例子一?展示了可用通过元素修改style中的属?甚至是class中的.唯一要提到的是textAlign是从style中的text-align中演变而来?有一条基本规?是style中的属性如果出?则在dom中将会被Lq且随后的一个字母将改ؓ大写,q有一点就是如果即使元素中没有style属?上述例子同样可以使用?BR>
text nodes:
先看一下例子:
<p id="sample1">This is the initial text.</p>
... code for the links ...
document.getElementById('sample1').firstChild.nodeValue =
'Once upon a time...';
document.getElementById('sample1').firstChild.nodeValue =
'...in a galaxy far, far away';
首先text nodesq没有像elements那样hid属?所有它q不能直接通过document.getElementById()或者document.getElementsByTagName()讉K
看一下下面的l构也许会更明白一些:
click for full size
可以看出通过document.getElementById('sample1').firstChild.nodeValue可以读取或者设|text nodes的g?BR>
另一个更加复杂一点的例子Q?BR><p id="sample2">This is the <b>initial</b> text.</p>
它的文l构
click for full size
在这里通过document.getElementById('sample1').firstChild.nodeValue讲仅仅改?This is the"
?B>initial text.不会改?在这里大家应该看C它和innerHTML的不同了.当然你也可以q样用:
document.getElementById('sample3').firstChild.nodeValue =
'<b>Once</b> upon a time...';
document.getElementById('sample3').firstChild.nodeValue =
'...in a galaxy <i>far, far</i> away';
其中的html代码不会被解释,览器将把他们当成普通的文本来显C?BR>
创徏和删除text nodes:
var myTextNode = document.createTextNode("my text");
通过上面的代码你可以创徏一个新的text node,但是它ƈ不是文树的一部分,要让它显C在面上就必须让它成ؓ文树中某一个节点的child,因ؓ
text nodes不能有儿?所以你不能它加入C个text nodes?attribute也不属于文档树的一部分,q条路也不行,现在只剩下elements nodes
?以下的例子展CZ如何d和删除一个text nodeQ?BR><p id="sample1">Initial text within a paragraph element.</p>
... code to add a text node ...
var text = document.createTextNode(" new text " + (++counter1));
var el = document.getElementById("sample1");
el.appendChild(text);
... code to remove the last child node ...
var el = document.getElementById("sample1");
if (el.hasChildNodes())
el.removeChild(el.lastChild);
增加文本是很Ҏ(gu)?上面的代码徏立了一个新的text nodeq且通过appendChild()Ҏ(gu)其加入到childNodes数组的末?q设|了一个counter1的全局变量,利于观察
hasChildNodes()的返回值是true or false;用来判断当前节点是否q有child,以阻止当其没有child的时候调用removeChild()产生的错误?BR>
创徏element nodes
有了上面的基,应该更容易理解了,先看一下下面的代码
<div id="sample1">This text is in a DIV element.</div>
... code for the link ...
var paraEl, boldEl;
paraEl = document.createElement("p");
boldEl = document.createElement("b");
paraEl.appendChild(document.createTextNode("This is a new paragraph with "));
boldEl.appendChild(document.createTextNode("bold"));
paraEl.appendChild(boldEl);
paraEl.appendChild(document.createTextNode(" text added to the DIV"));
document.getElementById("sample1").appendChild(paraEl);
你还可以直接为新加的element nodes讄attribute,以下两种都可?
boldEl.style.color = "#ffff00";
paraEl.appendChild(boldEl);
或?
paraEl.appendChild(boldEl);
boldEl.style.color = "#ffff00";

?此文主要来自于一些英文资料和w边的一些参考书,如果有错误大家请指出,一赯?DOM我一点也不熟?BR>

rodney 2005-09-19 13:28 发表评论
]]>
վ֩ģ壺 һػɫëƬѿ| xxxxƵѲֱ| ӰԺһ| selaobanƵѾƷ| ޹һվƷѿ| ֻˬֳƵ| 99aƷ| AVһDV| ѿJIZZƵ| ƷŮͬһѲ| ޾Ʒ͵Բ| ëƬ18ŮëƬƵδ | 72paoƵ| ˾žŴɫ㽶վ| һ| ձ| aav鶹| AV뾫Ʒ| ɫˬƵ| 99߹ۿ| һëƬѿ˾| ˳ۺվ7777㽶| ۺAVһ| ѹۿëƬֻƵ| Ƶ߹ۿ| ޾ƷƵ| ޹av| AVŷAVվ| պavѹۿ| 84paoǿѸ| ߹ۿѹۿ| ޾Ʒ͵Բ| þþþAVרJN | AVƬ߲| ѳߵӰ| һձƵѹۿ| ޹Ʒþ| ഺɫƷ| ޳ɫWWWþվ| Ļߵ| ֻ߹ۿƵ|