??xml version="1.0" encoding="utf-8" standalone="yes"?>一本天堂ⅴ无码亚洲道久久,MM1313亚洲精品无码久久,亚洲天堂电影在线观看http://m.tkk7.com/xiaoyi/category/33890.html阛_d风雨?让我们在雨中毅然前行,收获每一份喜悦的Ƣ笑o(∩_?o...zh-cnWed, 21 Sep 2011 19:08:16 GMTWed, 21 Sep 2011 19:08:16 GMT60js清空<input type="file">字段的?避免不必要的文g上传到服务器http://m.tkk7.com/xiaoyi/articles/359162.html可爱的小?/dc:creator>可爱的小?/author>Wed, 21 Sep 2011 07:39:00 GMThttp://m.tkk7.com/xiaoyi/articles/359162.htmlhttp://m.tkk7.com/xiaoyi/comments/359162.htmlhttp://m.tkk7.com/xiaoyi/articles/359162.html#Feedback0http://m.tkk7.com/xiaoyi/comments/commentRss/359162.htmlhttp://m.tkk7.com/xiaoyi/services/trackbacks/359162.html上传文gӞ需要验证文件格式,不符合规则就不允怸传,必须清空<input type="file">字段的|否则q是会上传到服务器!

1?|上各位兄弟提出了方法AQ删除掉原来?lt;input type="file">元素Q再马上新添加一个同名同id的file字段
<div id="a"><input type="file"></div>  像这?file字段嵌套在div里面 清空div的innerHTMLQ或清空他子节点Q?再新增innerHTMLQ或 子节点)
q种比较ȝQ必L动HTML代码 不予考虑?br />

2、直接上代码Q不废话!如下Q?
 1 <script language="javascript">
 2 if(window.HTMLElement) {
 3    HTMLElement.prototype.__defineSetter__("outerHTML",function(sHTML){
 4        var r=this.ownerDocument.createRange();
 5        r.setStartBefore(this);
 6        var df=r.createContextualFragment(sHTML);
 7        this.parentNode.replaceChild(df,this);
 8        return sHTML;
 9        }
);
10
11    HTMLElement.prototype.__defineGetter__("outerHTML",function(){
12     var attr;
13        var attrs=this.attributes;
14        var str="<"+this.tagName.toLowerCase();
15        for(var i=0;i<attrs.length;i++){
16            attr=attrs[i];
17            if(attr.specified)
18                str+=" "+attr.name+'="'+attr.value+'"';
19            }

20        if(!this.canHaveChildren)
21            return str+">";
22        return str+">"+this.innerHTML+"</"+this.tagName.toLowerCase()+">";
23        }
);
24        
25 HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){
26  switch(this.tagName.toLowerCase()){
27            case "area":
28            case "base":
29         case "basefont":
30            case "col":
31            case "frame":
32            case "hr":
33            case "img":
34            case "br":
35            case "input":
36            case "isindex":
37            case "link":
38            case "meta":
39            case "param":
40            return false;
41        }

42        return true;
43
44     }
);
45}

46
47
48 function clearFile(){
49 var obj = document.getElementById("fileID");
50 obj.outerHTML = obj.outerHTML;
51 }

52 </script>
53
54<input type="file" name="fileName" id="fileID"><input type="button" value="清空" onclick="clearFile()"/>

l测试,IE 火狐 h都有效,仅作整理收藏Q如果能帮到其他人就更好了!



]]>
Javascript实现MD5加密http://m.tkk7.com/xiaoyi/articles/356705.html可爱的小?/dc:creator>可爱的小?/author>Wed, 17 Aug 2011 04:05:00 GMThttp://m.tkk7.com/xiaoyi/articles/356705.htmlhttp://m.tkk7.com/xiaoyi/comments/356705.htmlhttp://m.tkk7.com/xiaoyi/articles/356705.html#Feedback0http://m.tkk7.com/xiaoyi/comments/commentRss/356705.htmlhttp://m.tkk7.com/xiaoyi/services/trackbacks/356705.html<script src="scripts/md5.js" type="text/javascript"></script>2、md5.JS ...  阅读全文

]]>
毅收藏?-----使用JavaScript复杂表格导ZؓExcel http://m.tkk7.com/xiaoyi/articles/295046.html可爱的小?/dc:creator>可爱的小?/author>Mon, 14 Sep 2009 09:58:00 GMThttp://m.tkk7.com/xiaoyi/articles/295046.htmlhttp://m.tkk7.com/xiaoyi/comments/295046.htmlhttp://m.tkk7.com/xiaoyi/articles/295046.html#Feedback0http://m.tkk7.com/xiaoyi/comments/commentRss/295046.htmlhttp://m.tkk7.com/xiaoyi/services/trackbacks/295046.html阅读全文

]]>
毅收藏?-----实用且不花哨的js代码大全http://m.tkk7.com/xiaoyi/articles/293853.html可爱的小?/dc:creator>可爱的小?/author>Fri, 04 Sep 2009 04:55:00 GMThttp://m.tkk7.com/xiaoyi/articles/293853.htmlhttp://m.tkk7.com/xiaoyi/comments/293853.htmlhttp://m.tkk7.com/xiaoyi/articles/293853.html#Feedback0http://m.tkk7.com/xiaoyi/comments/commentRss/293853.htmlhttp://m.tkk7.com/xiaoyi/services/trackbacks/293853.html阅读全文

]]>
毅收藏?-----JS 中面向对象的5U写?/title><link>http://m.tkk7.com/xiaoyi/articles/290879.html</link><dc:creator>可爱的小?/dc:creator><author>可爱的小?/author><pubDate>Wed, 12 Aug 2009 11:31:00 GMT</pubDate><guid>http://m.tkk7.com/xiaoyi/articles/290879.html</guid><wfw:comment>http://m.tkk7.com/xiaoyi/comments/290879.html</wfw:comment><comments>http://m.tkk7.com/xiaoyi/articles/290879.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/xiaoyi/comments/commentRss/290879.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/xiaoyi/services/trackbacks/290879.html</trackback:ping><description><![CDATA[<p> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080"> 1</span><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #008000">//</span><span style="color: #008000">W?U写?nbsp;  </span><span style="color: #008000"><br /> </span><span style="color: #008080"> 2</span><span style="color: #008000"><img id="Codehighlighter1_30_56_Open_Image" onclick="this.style.display='none'; Codehighlighter1_30_56_Open_Text.style.display='none'; Codehighlighter1_30_56_Closed_Image.style.display='inline'; Codehighlighter1_30_56_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_30_56_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_30_56_Closed_Text.style.display='none'; Codehighlighter1_30_56_Open_Image.style.display='inline'; Codehighlighter1_30_56_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #000000">function Circle(r) </span><span id="Codehighlighter1_30_56_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_30_56_Open_Text"><span style="color: #000000">{   <br /> </span><span style="color: #008080"> 3</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />      </span><span style="color: #0000ff">this</span><span style="color: #000000">.r </span><span style="color: #000000">=</span><span style="color: #000000"> r;   <br /> </span><span style="color: #008080"> 4</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000">   <br /> </span><span style="color: #008080"> 5</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />Circle.PI </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">3.14159</span><span style="color: #000000">;   <br /> </span><span style="color: #008080"> 6</span><span style="color: #000000"><img id="Codehighlighter1_120_166_Open_Image" onclick="this.style.display='none'; Codehighlighter1_120_166_Open_Text.style.display='none'; Codehighlighter1_120_166_Closed_Image.style.display='inline'; Codehighlighter1_120_166_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_120_166_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_120_166_Closed_Text.style.display='none'; Codehighlighter1_120_166_Open_Image.style.display='inline'; Codehighlighter1_120_166_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" />Circle.prototype.area </span><span style="color: #000000">=</span><span style="color: #000000"> function() </span><span id="Codehighlighter1_120_166_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_120_166_Open_Text"><span style="color: #000000">{   <br /> </span><span style="color: #008080"> 7</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  </span><span style="color: #0000ff">return</span><span style="color: #000000"> Circle.PI </span><span style="color: #000000">*</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.r </span><span style="color: #000000">*</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.r;   <br /> </span><span style="color: #008080"> 8</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000">   <br /> </span><span style="color: #008080"> 9</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  <br /> </span><span style="color: #008080">10</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />var c </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Circle(</span><span style="color: #000000">1.0</span><span style="color: #000000">);      <br /> </span><span style="color: #008080">11</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />alert(c.area());   </span></div> <p> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080"> 1</span><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #008000">//</span><span style="color: #008000">W?U写?nbsp;  </span><span style="color: #008000"><br /> </span><span style="color: #008080"> 2</span><span style="color: #008000"><img id="Codehighlighter1_35_194_Open_Image" onclick="this.style.display='none'; Codehighlighter1_35_194_Open_Text.style.display='none'; Codehighlighter1_35_194_Closed_Image.style.display='inline'; Codehighlighter1_35_194_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_35_194_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_35_194_Closed_Text.style.display='none'; Codehighlighter1_35_194_Open_Image.style.display='inline'; Codehighlighter1_35_194_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #000000">var Circle </span><span style="color: #000000">=</span><span style="color: #000000"> function() </span><span id="Codehighlighter1_35_194_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_35_194_Open_Text"><span style="color: #000000">{   <br /> </span><span style="color: #008080"> 3</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />   var obj </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Object();   <br /> </span><span style="color: #008080"> 4</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />   obj.PI </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">3.14159</span><span style="color: #000000">;   <br /> </span><span style="color: #008080"> 5</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />      <br /> </span><span style="color: #008080"> 6</span><span style="color: #000000"><img id="Codehighlighter1_129_171_Open_Image" onclick="this.style.display='none'; Codehighlighter1_129_171_Open_Text.style.display='none'; Codehighlighter1_129_171_Closed_Image.style.display='inline'; Codehighlighter1_129_171_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_129_171_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_129_171_Closed_Text.style.display='none'; Codehighlighter1_129_171_Open_Image.style.display='inline'; Codehighlighter1_129_171_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />   obj.area </span><span style="color: #000000">=</span><span style="color: #000000"> function( r ) </span><span id="Codehighlighter1_129_171_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_129_171_Open_Text"><span style="color: #000000">{   <br /> </span><span style="color: #008080"> 7</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />       </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.PI </span><span style="color: #000000">*</span><span style="color: #000000"> r </span><span style="color: #000000">*</span><span style="color: #000000"> r;   <br /> </span><span style="color: #008080"> 8</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />   }</span></span><span style="color: #000000">   <br /> </span><span style="color: #008080"> 9</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />   </span><span style="color: #0000ff">return</span><span style="color: #000000"> obj;   <br /> </span><span style="color: #008080">10</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000">   <br /> </span><span style="color: #008080">11</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  <br /> </span><span style="color: #008080">12</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />var c </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Circle();   <br /> </span><span style="color: #008080">13</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />alert( c.area( </span><span style="color: #000000">1.0</span><span style="color: #000000"> ) );  <br /> </span><span style="color: #008080">14</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080">1</span><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #008000">//</span><span style="color: #008000">W?U写?nbsp;  </span><span style="color: #008000"><br /> </span><span style="color: #008080">2</span><span style="color: #008000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #000000">var Circle </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Object();   <br /> </span><span style="color: #008080">3</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />Circle.PI </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">3.14159</span><span style="color: #000000">;   <br /> </span><span style="color: #008080">4</span><span style="color: #000000"><img id="Codehighlighter1_93_132_Open_Image" onclick="this.style.display='none'; Codehighlighter1_93_132_Open_Text.style.display='none'; Codehighlighter1_93_132_Closed_Image.style.display='inline'; Codehighlighter1_93_132_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_93_132_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_93_132_Closed_Text.style.display='none'; Codehighlighter1_93_132_Open_Image.style.display='inline'; Codehighlighter1_93_132_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" />Circle.Area </span><span style="color: #000000">=</span><span style="color: #000000"> function( r ) </span><span id="Codehighlighter1_93_132_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_93_132_Open_Text"><span style="color: #000000">{   <br /> </span><span style="color: #008080">5</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />       </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.PI </span><span style="color: #000000">*</span><span style="color: #000000"> r </span><span style="color: #000000">*</span><span style="color: #000000"> r;   <br /> </span><span style="color: #008080">6</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000">   <br /> </span><span style="color: #008080">7</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  <br /> </span><span style="color: #008080">8</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />alert( Circle.Area( </span><span style="color: #000000">1.0</span><span style="color: #000000"> ) );</span></div> <p> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080">1</span><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #008000">//</span><span style="color: #008000">W?U写?nbsp;  </span><span style="color: #008000"><br /> </span><span style="color: #008080">2</span><span style="color: #008000"><img id="Codehighlighter1_22_121_Open_Image" onclick="this.style.display='none'; Codehighlighter1_22_121_Open_Text.style.display='none'; Codehighlighter1_22_121_Closed_Image.style.display='inline'; Codehighlighter1_22_121_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_22_121_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_22_121_Closed_Text.style.display='none'; Codehighlighter1_22_121_Open_Image.style.display='inline'; Codehighlighter1_22_121_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #000000">var Circle</span><span style="color: #000000">=</span><span id="Codehighlighter1_22_121_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_22_121_Open_Text"><span style="color: #000000">{   <br /> </span><span style="color: #008080">3</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />   </span><span style="color: #000000">"</span><span style="color: #000000">PI</span><span style="color: #000000">"</span><span style="color: #000000">:</span><span style="color: #000000">3.14159</span><span style="color: #000000">,   <br /> </span><span style="color: #008080">4</span><span style="color: #000000"><img id="Codehighlighter1_66_116_Open_Image" onclick="this.style.display='none'; Codehighlighter1_66_116_Open_Text.style.display='none'; Codehighlighter1_66_116_Closed_Image.style.display='inline'; Codehighlighter1_66_116_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_66_116_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_66_116_Closed_Text.style.display='none'; Codehighlighter1_66_116_Open_Image.style.display='inline'; Codehighlighter1_66_116_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #000000">"</span><span style="color: #000000">area</span><span style="color: #000000">"</span><span style="color: #000000">:function(r)</span><span id="Codehighlighter1_66_116_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_66_116_Open_Text"><span style="color: #000000">{   <br /> </span><span style="color: #008080">5</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />          </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.PI </span><span style="color: #000000">*</span><span style="color: #000000"> r </span><span style="color: #000000">*</span><span style="color: #000000"> r;   <br /> </span><span style="color: #008080">6</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000">   <br /> </span><span style="color: #008080">7</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000">;   <br /> </span><span style="color: #008080">8</span><span style="color: #000000"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />alert( Circle.area(</span><span style="color: #000000">1.0</span><span style="color: #000000">) );  </span></div> <p> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #008000">//</span><span style="color: #008000">W?U写?nbsp;  </span><span style="color: #008000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #000000">var Circle </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Function(</span><span style="color: #000000">"</span><span style="color: #000000">this.PI = 3.14159;this.area = function( r ) {return r*r*this.PI;}</span><span style="color: #000000">"</span><span style="color: #000000">);   <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />alert( (</span><span style="color: #0000ff">new</span><span style="color: #000000"> Circle()).area(</span><span style="color: #000000">1.0</span><span style="color: #000000">) );  </span></div> <p> </p> <img src ="http://m.tkk7.com/xiaoyi/aggbug/290879.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/xiaoyi/" target="_blank">可爱的小?/a> 2009-08-12 19:31 <a href="http://m.tkk7.com/xiaoyi/articles/290879.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>毅收藏?-----JavaScript操作XML文ghttp://m.tkk7.com/xiaoyi/articles/290000.html可爱的小?/dc:creator>可爱的小?/author>Wed, 05 Aug 2009 14:01:00 GMThttp://m.tkk7.com/xiaoyi/articles/290000.htmlhttp://m.tkk7.com/xiaoyi/comments/290000.htmlhttp://m.tkk7.com/xiaoyi/articles/290000.html#Feedback0http://m.tkk7.com/xiaoyi/comments/commentRss/290000.htmlhttp://m.tkk7.com/xiaoyi/services/trackbacks/290000.html用javascript操作xml

文中量用上所有的操作和属性,以做C

<script language="JavaScript">
<!--
var doc = new ActiveXObject("Msxml2.DOMDocument"); //ie5.5+,CreateObject("Microsoft.XMLDOM") 


//加蝲文
//
doc.load("b.xml");

//创徏文g?/span>
var p = doc.createProcessingInstruction("xml","version='1.0'  encoding='gb2312'");

    
//d文g?/span>
    doc.appendChild(p);

//用于直接加蝲时获得根接点
//
var root = doc.documentElement;

//两种方式创徏Ҏ?/span>
//
    var root = doc.createElement("students");
    var root = doc.createNode(1,"students","");

    
//创徏子接?/span>
    var n = doc.createNode(1,"ttyp","");

        
//指定子接Ҏ?/span>
        //n.text = " this is a test";
    
    
//创徏孙接?/span>
    var o = doc.createElement("sex");
        o.text 
= "?/span>";    //指定其文?/span>

    
//创徏属?/span>
    var r = doc.createAttribute("id");
        r.value
="test";

        
//d属?/span>
        n.setAttributeNode(r);

    
//创徏W二个属?nbsp;   
    var r1 = doc.createAttribute("class");
        r1.value
="tt";
        
        
//d属?/span>
        n.setAttributeNode(r1);

        
//删除W二个属?/span>
        n.removeAttribute("class");

        
//d孙接?/span>
        n.appendChild(o);

        
//d文本接点
        n.appendChild(doc.createTextNode("this is a text node."));

        
//d注释
        n.appendChild(doc.createComment("this is a comment\n"));
    
        
//d子接?/span>
        root.appendChild(n);
    
    
//复制接点
    var m = n.cloneNode(true);

        root.appendChild(m);
        
        
//删除接点
        root.removeChild(root.childNodes(0));

    
//创徏数据D?/span>
    var c = doc.createCDATASection("this is a cdata");
        c.text 
= "hi,cdata";
        
//d数据D?/span>
        root.appendChild(c);
    
    
//dҎ?/span>
    doc.appendChild(root);

    
//查找接点
    var a = doc.getElementsByTagName("ttyp");
    
//var a = doc.selectNodes("http://ttyp");

    
//昄Ҏ点的属?/span>
    for(var i= 0;i<a.length;i++)
    
{
        alert(a[i].xml);
        
for(var j=0;j<a[i].attributes.length;j++)
        
{
            alert(a[i].attributes[j].name);
        }

    }


    
//修改节点,利用XPATH定位节点
    var b = doc.selectSingleNode("//ttyp/sex");
    b.text 
= "?/span>";

    
//alert(doc.xml);

    
//XML保存Q需要在服务端,客户端用FSOQ?/span>
    //doc.save();
    
    
//查看Ҏ点XML
    if(n)
    
{
        alert(n.ownerDocument.xml);
    }


//-->
</script>


]]>
iframe试牛刀http://m.tkk7.com/xiaoyi/articles/232004.html可爱的小?/dc:creator>可爱的小?/author>Wed, 01 Oct 2008 08:41:00 GMThttp://m.tkk7.com/xiaoyi/articles/232004.htmlhttp://m.tkk7.com/xiaoyi/comments/232004.htmlhttp://m.tkk7.com/xiaoyi/articles/232004.html#Feedback0http://m.tkk7.com/xiaoyi/comments/commentRss/232004.htmlhttp://m.tkk7.com/xiaoyi/services/trackbacks/232004.htmliframe替换textarea---只要开?iframe?disignMode卛_

<html>
<head></head>  
<script language="javascript">

</script>
<body onload="edit.document.designMode='on'" > 
   
<table border="1" width="100%" id=edit >
   
<tr>
   
<td width="100%">
   
   
<IFRAME id=edit marginWidth=0 marginHeight=0 frameBorder=1 width="100%" height="100%"  src="about:blank"></IFRAME>
   
   
</td>
   
</tr>
   
</table>
</body>
<html>
bb.htm代码如下Q?br /> 一直无法在iframe中谈告框。很是郁闗差点吐血?br /> 后来发现edit.htmq样写就行了Q?br />
<script language="javascript">

function showContextMenu()
{
//child.focus();
    alert("Show it!");
return false;
}

edit.document.designMode
="on";
edit.document.focus();
edit.document.contentEditable 
= true
edit.document.oncontextmenu 
= showContextMenu;   //oncontextmenu事g是鼠标右键单L
//edit.document.selection.createRange().setEndPoint("StartToStart",1) 
</script>



]]>
js获取textarea中输入文本的本选择内容http://m.tkk7.com/xiaoyi/articles/231994.html可爱的小?/dc:creator>可爱的小?/author>Wed, 01 Oct 2008 07:09:00 GMThttp://m.tkk7.com/xiaoyi/articles/231994.htmlhttp://m.tkk7.com/xiaoyi/comments/231994.htmlhttp://m.tkk7.com/xiaoyi/articles/231994.html#Feedback0http://m.tkk7.com/xiaoyi/comments/commentRss/231994.htmlhttp://m.tkk7.com/xiaoyi/services/trackbacks/231994.html function getFieldSelection(select_field) { word=''; if (document.selection) { var sel = document.selection.createRange(); if (sel.text.length > 0) { word = sel.text; } } else if (select_field.selectionStart || select_field.selectionStart == '0') { var startP = select_field.selectionStart; var endP = select_field.selectionEnd; if (startP != endP) { word = select_field.value.substring(startP, endP); } } return word; }