??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品亚洲αv天堂无码,久久亚洲春色中文字幕久久久,国产亚洲?V无码?V男人的天堂 http://m.tkk7.com/supercrsky/category/27726.html专注于JavaWeb开?/description>zh-cnSat, 31 May 2008 00:45:43 GMTSat, 31 May 2008 00:45:43 GMT60好用的JS验证框架(LiveValidation)http://m.tkk7.com/supercrsky/articles/204130.html々上善若水?/dc:creator>々上善若水?/author>Fri, 30 May 2008 08:48:00 GMThttp://m.tkk7.com/supercrsky/articles/204130.htmlhttp://m.tkk7.com/supercrsky/comments/204130.htmlhttp://m.tkk7.com/supercrsky/articles/204130.html#Feedback2http://m.tkk7.com/supercrsky/comments/commentRss/204130.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/204130.htmlq个验证表单强?/p>

 

输入 hello : 误入hello!
非空 : Thankyou!
格式 (包含 live ): 无效!
正则表达?



 

数字验证(M数字): 必须是数?
数字验证(必须为整?: 必须是数?
具体数字验证: 必须是数?
大于数字验证Q?必须是数?
于数字验证 : 必须是数?
?个数字之?.能用数(2000--2003)Q?必须是数?
?个数字之?.不能用小?2000--2003)Q?必须是数?



长度验证({于4?Q?
长度验证(大于{于4?Q?
长度验证(于{于4?Q?
长度验证(4?个字W长?Q?


_匚w(输入cssrain或者our或者cake):
部分匚w:


跟上?个例子相反(一个是包括Q一个是排除Q?br /> 排斥_匚w(输入cssrain或者our或者cake):
排斥部分匚w:


验证复选框:
密码认Q?
认密码:
Email验证:
Email验证(l合校验不能于10大于20?

l过我的修改Q提CZ息已l是中文的。用户可以根据自q需要修改相应的提示信息?/div>
 

 

LiveValidation中文修改版下?/a>



]]>用JavaScript计算字符串占用字节数 http://m.tkk7.com/supercrsky/articles/204023.html々上善若水?/dc:creator>々上善若水?/author>Fri, 30 May 2008 02:09:00 GMThttp://m.tkk7.com/supercrsky/articles/204023.htmlhttp://m.tkk7.com/supercrsky/comments/204023.htmlhttp://m.tkk7.com/supercrsky/articles/204023.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/204023.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/204023.html原帖地址

最q和JavaScriptU缠上了?/p>

遇到q么一个问题,数据库的字符集ؓUTF-8的,要在面上用JavaScript验证输入的文本用UTF-8存储时占用字节长度。JavaScript的String对象有length属性,但是q个计算的是字符敎ͼ不是字节敎ͼ问题LL覆去的,记得当年玩Delphi的时候,q得写程序计字W串的字W数Q因为Delphi中String的length是字节数...Q。偷懒一点的办法是将验证代码中最大长度设|ؓ数据库中对应字段的长度的1/3Q但是这样准来说有点不合适?/p>

所以想办法在JavaScript中判断在UTF-8下存储的String的字节数Q在|上扑ֈ很多关于Unicode介绍的文,最重要的是字符~码数值对应的存储长度Q?/p>

UCS-2~码(16q制) UTF-8 字节?二进?
0000 - 007F 0xxxxxxx Q?字节Q?br /> 0080 - 07FF 110xxxxx 10xxxxxx Q?字节Q?br /> 0800 - FFFF 1110xxxx 10xxxxxx 10xxxxxx Q?字节Q?

 

于是代码如下Q?/p>

 

function mbStringLength(s) {
        
var totalLength = 0;
        
var i;
        
var charCode;
        
for (i = 0; i < s.length; i++{
          charCode 
= s.charCodeAt(i);
          
if (charCode < 0x007f{
            totalLength 
= totalLength + 1;
          }
 else if ((0x0080 <= charCode) && (charCode <= 0x07ff)) {
            totalLength 
+= 2;
          }
 else if ((0x0800 <= charCode) && (charCode <= 0xffff)) {
            totalLength 
+= 3;
          }

        }

        
//alert(totalLength);
        return totalLength;
      }
 

 

 

实际?0x0080?x07ff之间的字W很会在实际用戯入中用到?/p>

 

参考文:

E序员趣呌物:谈谈Unicode~码 http://www.lihuasoft.net/article/show.php?id=2778



]]>
强的Javascript仿QQD菜单http://m.tkk7.com/supercrsky/articles/200960.html々上善若水?/dc:creator>々上善若水?/author>Fri, 16 May 2008 09:10:00 GMThttp://m.tkk7.com/supercrsky/articles/200960.htmlhttp://m.tkk7.com/supercrsky/comments/200960.htmlhttp://m.tkk7.com/supercrsky/articles/200960.html#Feedback1http://m.tkk7.com/supercrsky/comments/commentRss/200960.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/200960.html阅读全文

]]>
验证文g扩展名的jshttp://m.tkk7.com/supercrsky/articles/200417.html々上善若水?/dc:creator>々上善若水?/author>Wed, 14 May 2008 08:04:00 GMThttp://m.tkk7.com/supercrsky/articles/200417.htmlhttp://m.tkk7.com/supercrsky/comments/200417.htmlhttp://m.tkk7.com/supercrsky/articles/200417.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/200417.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/200417.html/**
        验证文g扩展名是否合?br />     *
*/

   
function  checkFiles(str)
   
{
        
var strRegex = "(.jpg|.png|.gif|.ps|.jpeg)$"//用于验证囄扩展名的正则表达?/span>
        var re=new RegExp(strRegex);
        
if (re.test(str.toLowerCase())){
            
return true;
        }

        
else{
            alert(
"文g名不合法,文g的扩展名必须为jpg,jpeg,gif或ps格式"); 
            
return false;
        }

   }


]]>
计算两个日期之间的工作日和非工作?转自曦)http://m.tkk7.com/supercrsky/articles/197438.html々上善若水?/dc:creator>々上善若水?/author>Wed, 30 Apr 2008 01:10:00 GMThttp://m.tkk7.com/supercrsky/articles/197438.htmlhttp://m.tkk7.com/supercrsky/comments/197438.htmlhttp://m.tkk7.com/supercrsky/articles/197438.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/197438.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/197438.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
  
<TITLE> 作者:风中?nbsp;</TITLE>
  
<META NAME="Generator" CONTENT="EditPlus">
  
<META NAME="Author" CONTENT="">
  
<META NAME="Keywords" CONTENT="">
  
<META NAME="Description" CONTENT="">

<SCRIPT LANGUAGE="JavaScript">
  
//string转换为Date
  //str必须满如下格式: 2008-04-29
  function convertString2Date(str)
  
{
   
//用户split分隔出数l?包?个元?q???/span>
   var splitArray = str.split("-");
   
   
// 用年,?日构造日期对?/span>
   // splitArray[0]-> year, splitArray[1]-> month, splitArray[2]->day
   // q时要注意月份是?开始的
   var date = new Date(splitArray[0], splitArray[1- 1, splitArray[2]);
  
   
return date;
  }


  
// 得到date1和date2之间的间?/span>
  // date2要比date1?/span>
  // date要满_下格? 2008-04-29
  //参数date1和date2cd应该是String或Date
  // 保两种cd没有问题
  function getIntervalBetweenTwoDates(date1, date2)
  
{
   
var realDate1 = date1;
   
var realDate2 = date2;
   
   
// 如果date1是Datecd׃用{?/span>
   if(!(date1 instanceof Date))
   
{
    realDate1 
= convertString2Date(date1);
   }

   
// 如果date2是Datecd׃用{?/span>
   if(!(date2 instanceof Date))
   
{
    realDate2 
= convertString2Date(date2);
   }

   
   
//得到l对?(realDate2.getTime() - realDate1.getTime())q回的是毫秒所以要先除1000
   var interval = Math.abs((realDate2.getTime() - realDate1.getTime()))/(1000 * 60 * 60 * 24);
   
   
return interval;
  }


  
function listAllDatesBetweenTwoDates()
  
{
   
var date1 = document.getElementById("start").value;
   
var date2 = document.getElementById("end").value;
   
var target = document.getElementById("result");
   
var interval = getIntervalBetweenTwoDates(date1,date2);
   
// 转换string为Date
   date1 = convertString2Date(date1);   
   
var year = date1.getFullYear();
   
var month = date1.getMonth();
   
var date = date1.getDate();
   
--date;
   
   
for(var i = 0 ; i <= interval ; ++i)
   
{
    
++date;
    
    
var theDate = new Date(year, month, date);
    
var tempYear = theDate.getFullYear();
    
var tempMonth = theDate.getMonth() + 1;
    
var tempDate = theDate.getDate();
    
var day = theDate.getDay();
    
var working = null;
    
if(0 == day || 6 == day) // non-working day
    {
     working 
= "non-working day";
    }

    
else
    
{
     working 
= "working day";
    }

    
var theResult = tempYear + "-" + tempMonth + "-" + tempDate + " is " + working;
    
var div = document.createElement("div");
    
    div.innerHTML 
= theResult;
    target.appendChild(div); 
    
   }

  }


</SCRIPT>
</HEAD>
<BODY>
  
start date:
<input type="text" length="20" id="start"><br>
end date:
<input type="text" length="20" id="end"><br>
<input type="button" onclick="listAllDatesBetweenTwoDates()" value="result">
<div id="result"></div>
</BODY>
</HTML>


]]>
万能的alt属?/title><link>http://m.tkk7.com/supercrsky/articles/183300.html</link><dc:creator>々上善若水?/dc:creator><author>々上善若水?/author><pubDate>Sun, 02 Mar 2008 12:45:00 GMT</pubDate><guid>http://m.tkk7.com/supercrsky/articles/183300.html</guid><wfw:comment>http://m.tkk7.com/supercrsky/comments/183300.html</wfw:comment><comments>http://m.tkk7.com/supercrsky/articles/183300.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/supercrsky/comments/commentRss/183300.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/supercrsky/services/trackbacks/183300.html</trackback:ping><description><![CDATA[     摘要:   <!-- /**//* @ JavaScript X-Alt 2.0b  @ 作者:Andyfoo @ 功能Q提C工h @ 日期Q?008-3-1 @ |址Qhttp://www.getcn.net    http://www.andyfoo....  <a href='http://m.tkk7.com/supercrsky/articles/183300.html'>阅读全文</a><img src ="http://m.tkk7.com/supercrsky/aggbug/183300.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/supercrsky/" target="_blank">々上善若水?/a> 2008-03-02 20:45 <a href="http://m.tkk7.com/supercrsky/articles/183300.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>鼠标滚轮无控制囄大小http://m.tkk7.com/supercrsky/articles/181516.html々上善若水?/dc:creator>々上善若水?/author>Fri, 22 Feb 2008 14:00:00 GMThttp://m.tkk7.com/supercrsky/articles/181516.htmlhttp://m.tkk7.com/supercrsky/comments/181516.htmlhttp://m.tkk7.com/supercrsky/articles/181516.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/181516.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/181516.html<script language="JavaScript">
<!--

//无~放囄大小
function bbimg(o)
{
  
var zoom=parseInt(o.style.zoom, 10)||100;
  zoom
+=event.wheelDelta/12;
  
if (zoom>0) o.style.zoom=zoom+'%';
  
return false;
}

-->
</script>
<img id="p1" src="mpg.jpg" onmousewheel="return bbimg(this)">


]]>
JS的QQ菜单http://m.tkk7.com/supercrsky/articles/181514.html々上善若水?/dc:creator>々上善若水?/author>Fri, 22 Feb 2008 13:56:00 GMThttp://m.tkk7.com/supercrsky/articles/181514.htmlhttp://m.tkk7.com/supercrsky/comments/181514.htmlhttp://m.tkk7.com/supercrsky/articles/181514.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/181514.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/181514.html阅读全文

]]>
让form响应Ctrl+Entier?/title><link>http://m.tkk7.com/supercrsky/articles/179753.html</link><dc:creator>々上善若水?/dc:creator><author>々上善若水?/author><pubDate>Wed, 13 Feb 2008 02:47:00 GMT</pubDate><guid>http://m.tkk7.com/supercrsky/articles/179753.html</guid><wfw:comment>http://m.tkk7.com/supercrsky/comments/179753.html</wfw:comment><comments>http://m.tkk7.com/supercrsky/articles/179753.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/supercrsky/comments/commentRss/179753.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/supercrsky/services/trackbacks/179753.html</trackback:ping><description><![CDATA[<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: #0000ff"><!</span><span style="color: #ff00ff">DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.0   Transitional//EN "</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><</span><span style="color: #800000">HTML</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><</span><span style="color: #800000">HEAD</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><</span><span style="color: #800000">TITLE</span><span style="color: #0000ff">></span><span style="color: #000000">   New   Document   </span><span style="color: #0000ff"></</span><span style="color: #800000">TITLE</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img id="Codehighlighter1_157_285_Open_Image" onclick="this.style.display='none'; Codehighlighter1_157_285_Open_Text.style.display='none'; Codehighlighter1_157_285_Closed_Image.style.display='inline'; Codehighlighter1_157_285_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_157_285_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_157_285_Closed_Text.style.display='none'; Codehighlighter1_157_285_Open_Image.style.display='inline'; Codehighlighter1_157_285_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff"><</span><span style="color: #800000">SCRIPT </span><span style="color: #ff0000">LANGUAGE</span><span style="color: #0000ff">= "JavaScript"</span><span style="color: #0000ff">></span><span id="Codehighlighter1_157_285_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_157_285_Open_Text"><span style="color: #000000; background-color: #f5f5f5"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000; background-color: #f5f5f5"><!--</span><span style="color: #000000; background-color: #f5f5f5"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #0000ff; background-color: #f5f5f5">function</span><span style="color: #000000; background-color: #f5f5f5"> CHECKKEY()<br /> <img id="Codehighlighter1_183_277_Open_Image" onclick="this.style.display='none'; Codehighlighter1_183_277_Open_Text.style.display='none'; Codehighlighter1_183_277_Closed_Image.style.display='inline'; Codehighlighter1_183_277_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_183_277_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_183_277_Closed_Text.style.display='none'; Codehighlighter1_183_277_Open_Image.style.display='inline'; Codehighlighter1_183_277_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /></span><span id="Codehighlighter1_183_277_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_183_277_Open_Text"><span style="color: #000000; background-color: #f5f5f5">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />   </span><span style="color: #0000ff; background-color: #f5f5f5">if</span><span style="color: #000000; background-color: #f5f5f5">(event.keyCode </span><span style="color: #000000; background-color: #f5f5f5">==</span><span style="color: #000000; background-color: #f5f5f5"> </span><span style="color: #000000; background-color: #f5f5f5">13</span><span style="color: #000000; background-color: #f5f5f5">&&</span><span style="color: #000000; background-color: #f5f5f5">event.ctrlKey)<br /> <img id="Codehighlighter1_230_275_Open_Image" onclick="this.style.display='none'; Codehighlighter1_230_275_Open_Text.style.display='none'; Codehighlighter1_230_275_Closed_Image.style.display='inline'; Codehighlighter1_230_275_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_230_275_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_230_275_Closed_Text.style.display='none'; Codehighlighter1_230_275_Open_Image.style.display='inline'; Codehighlighter1_230_275_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />   </span><span id="Codehighlighter1_230_275_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_230_275_Open_Text"><span style="color: #000000; background-color: #f5f5f5">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />      alert( 'i   can   </span><span style="color: #0000ff; background-color: #f5f5f5">catch</span><span style="color: #000000; background-color: #f5f5f5">   it</span><span style="color: #000000; background-color: #f5f5f5">!</span><span style="color: #000000; background-color: #f5f5f5"> ');<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />   }</span></span><span style="color: #000000; background-color: #f5f5f5"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000; background-color: #f5f5f5"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" /></span><span style="color: #008000; background-color: #f5f5f5">//</span><span style="color: #008000; background-color: #f5f5f5"> --></span><span style="color: #008000; background-color: #f5f5f5"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></span><span style="color: #0000ff"></</span><span style="color: #800000">SCRIPT</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"></</span><span style="color: #800000">HEAD</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><</span><span style="color: #800000">BODY   </span><span style="color: #ff0000">ONKEYDOWN</span><span style="color: #0000ff">= "CHECKKEY()"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"></</span><span style="color: #800000">BODY</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"></</span><span style="color: #800000">HTML</span><span style="color: #0000ff">></span></div> Z说下按钮中的<strong>accesskey</strong>属性.<br /> 定义?strong>accesskey</strong>的链接可以用快捷键(<strong>ALT+字母</strong>)讉K.<br /> 比如: <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: #0000ff"><</span><span style="color: #800000">input </span><span style="color: #ff0000">type</span><span style="color: #0000ff">="button"</span><span style="color: #ff0000"> accesskey</span><span style="color: #0000ff">="s"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span></div> 可以用alt+s讉K此按钮.<br /> <br /> 2.如何使form中的submit按钮不响应回车键Q?br /> W一U方?form不响? <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: #0000ff"><</span><span style="color: #800000">form   </span><span style="color: #ff0000">onsubmit</span><span style="color: #0000ff">="return   false"</span><span style="color: #0000ff">></span></div> W二U方?整个html都不响应<br /> <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: #0000ff"><</span><span style="color: #800000">body </span><span style="color: #ff0000">onkeydown</span><span style="color: #0000ff">="if(event.keyCode==13){window.event.keyCode==0;window.event.returnValue=false}"</span><span style="color: #0000ff">></span></div> <img src ="http://m.tkk7.com/supercrsky/aggbug/179753.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/supercrsky/" target="_blank">々上善若水?/a> 2008-02-13 10:47 <a href="http://m.tkk7.com/supercrsky/articles/179753.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>判断一个form中的checkbox是否有被选中http://m.tkk7.com/supercrsky/articles/179702.html々上善若水?/dc:creator>々上善若水?/author>Tue, 12 Feb 2008 09:46:00 GMThttp://m.tkk7.com/supercrsky/articles/179702.htmlhttp://m.tkk7.com/supercrsky/comments/179702.htmlhttp://m.tkk7.com/supercrsky/articles/179702.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/179702.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/179702.html<html>

<head>

<title></title>
<script language="javascript" type="text/javascript">
    
function check()
    
{
        
var idss = document.getElementsByName("id");
        
var flag = false;
        
for(var i = 0; i < idss.length; i++)
        
{
            
if(idss[i].checked)
            
{
                flag 
= true;
            }

        }

        alert(flag);
        
return flag;
    }

</script>
</head>

<body>
<form name="aa">
    
<input type="checkbox" name="id" />
    
<input type="checkbox" name="id" />
    
<input type="checkbox" name="id" />
    
<input type="checkbox" name="id" />
    
<input type="button" onclick="check();" value="test"/>
</form>
</body>

</html>

]]>
清除或选中所有的checkbox http://m.tkk7.com/supercrsky/articles/179388.html々上善若水?/dc:creator>々上善若水?/author>Wed, 06 Feb 2008 03:06:00 GMThttp://m.tkk7.com/supercrsky/articles/179388.htmlhttp://m.tkk7.com/supercrsky/comments/179388.htmlhttp://m.tkk7.com/supercrsky/articles/179388.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/179388.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/179388.html对于有时候要选择或取消页面中的checkboxQ当然也服务器端也可以做。但总觉得效率不高。不如用JS的?br />

不涉及安全能用JSqJS。。?br />

<script language="javascript">
         
function SelectAll(tempControl)
        
{
            
var theBox=
tempControl;
            xState
=
theBox.checked;

            elem
=
theBox.form.elements;
            
for(i=0;i<elem.length;i++
)
            
if(elem[i].type=="checkbox" && elem[i].id!=
theBox.id)
             
{
                  
if(elem[i].checked!=
xState)
                  elem[i].click();
             }

      }
 
        
</script>

面中加上:

<INPUT onclick="javascript:SelectAll(this);" type="checkbox">选中所有的短消?/span>
其实其他的选择按钮也差不多的用法?/span>

]]>
JavaScript仿Office颜色选择?/title><link>http://m.tkk7.com/supercrsky/articles/179124.html</link><dc:creator>々上善若水?/dc:creator><author>々上善若水?/author><pubDate>Sun, 03 Feb 2008 02:56:00 GMT</pubDate><guid>http://m.tkk7.com/supercrsky/articles/179124.html</guid><wfw:comment>http://m.tkk7.com/supercrsky/comments/179124.html</wfw:comment><comments>http://m.tkk7.com/supercrsky/articles/179124.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/supercrsky/comments/commentRss/179124.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/supercrsky/services/trackbacks/179124.html</trackback:ping><description><![CDATA[     摘要:   <HTML> <HEAD> <TITLE> Office 风格颜色选择?lt;/TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> &...  <a href='http://m.tkk7.com/supercrsky/articles/179124.html'>阅读全文</a><img src ="http://m.tkk7.com/supercrsky/aggbug/179124.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/supercrsky/" target="_blank">々上善若水?/a> 2008-02-03 10:56 <a href="http://m.tkk7.com/supercrsky/articles/179124.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Javascript动态创建控?/title><link>http://m.tkk7.com/supercrsky/articles/178692.html</link><dc:creator>々上善若水?/dc:creator><author>々上善若水?/author><pubDate>Thu, 31 Jan 2008 08:07:00 GMT</pubDate><guid>http://m.tkk7.com/supercrsky/articles/178692.html</guid><wfw:comment>http://m.tkk7.com/supercrsky/comments/178692.html</wfw:comment><comments>http://m.tkk7.com/supercrsky/articles/178692.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/supercrsky/comments/commentRss/178692.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/supercrsky/services/trackbacks/178692.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"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff"><</span><span style="color: #800000">html</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">head</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">title</span><span style="color: #0000ff">></</span><span style="color: #800000">title</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img id="Codehighlighter1_85_688_Open_Image" onclick="this.style.display='none'; Codehighlighter1_85_688_Open_Text.style.display='none'; Codehighlighter1_85_688_Closed_Image.style.display='inline'; Codehighlighter1_85_688_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_85_688_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_85_688_Closed_Text.style.display='none'; Codehighlighter1_85_688_Open_Image.style.display='inline'; Codehighlighter1_85_688_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">script </span><span style="color: #ff0000">language</span><span style="color: #0000ff">="javascript"</span><span style="color: #ff0000"> type</span><span style="color: #0000ff">="text/javascript"</span><span style="color: #0000ff">></span><span id="Codehighlighter1_85_688_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 alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_85_688_Open_Text"><span style="color: #000000; background-color: #f5f5f5"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #0000ff; background-color: #f5f5f5">function</span><span style="color: #000000; background-color: #f5f5f5"> createElement(tagName, type)<br /> <img id="Codehighlighter1_124_463_Open_Image" onclick="this.style.display='none'; Codehighlighter1_124_463_Open_Text.style.display='none'; Codehighlighter1_124_463_Closed_Image.style.display='inline'; Codehighlighter1_124_463_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_124_463_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_124_463_Closed_Text.style.display='none'; Codehighlighter1_124_463_Open_Image.style.display='inline'; Codehighlighter1_124_463_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span id="Codehighlighter1_124_463_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 alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_124_463_Open_Text"><span style="color: #000000; background-color: #f5f5f5">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />   </span><span style="color: #0000ff; background-color: #f5f5f5">var</span><span style="color: #000000; background-color: #f5f5f5"> element </span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5"> </span><span style="color: #0000ff; background-color: #f5f5f5">null</span><span style="color: #000000; background-color: #f5f5f5">;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />   </span><span style="color: #0000ff; background-color: #f5f5f5">try</span><span style="color: #000000; background-color: #f5f5f5"><br /> <img id="Codehighlighter1_159_299_Open_Image" onclick="this.style.display='none'; Codehighlighter1_159_299_Open_Text.style.display='none'; Codehighlighter1_159_299_Closed_Image.style.display='inline'; Codehighlighter1_159_299_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_159_299_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_159_299_Closed_Text.style.display='none'; Codehighlighter1_159_299_Open_Image.style.display='inline'; Codehighlighter1_159_299_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   </span><span id="Codehighlighter1_159_299_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 alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_159_299_Open_Text"><span style="color: #000000; background-color: #f5f5f5">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      element </span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5"> document.createElement('</span><span style="color: #000000; background-color: #f5f5f5"><</span><span style="color: #000000; background-color: #f5f5f5">' </span><span style="color: #000000; background-color: #f5f5f5">+</span><span style="color: #000000; background-color: #f5f5f5"> tagName </span><span style="color: #000000; background-color: #f5f5f5">+</span><span style="color: #000000; background-color: #f5f5f5"> ' name</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">'+name+'</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5"> </span><span style="color: #000000; background-color: #f5f5f5">/></span><span style="color: #000000; background-color: #f5f5f5">');<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      element.type </span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5"> type;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      element.value </span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5"> value;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span></span><span style="color: #000000; background-color: #f5f5f5"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />   </span><span style="color: #0000ff; background-color: #f5f5f5">catch</span><span style="color: #000000; background-color: #f5f5f5"> (e)<br /> <img id="Codehighlighter1_317_322_Open_Image" onclick="this.style.display='none'; Codehighlighter1_317_322_Open_Text.style.display='none'; Codehighlighter1_317_322_Closed_Image.style.display='inline'; Codehighlighter1_317_322_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_317_322_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_317_322_Closed_Text.style.display='none'; Codehighlighter1_317_322_Open_Image.style.display='inline'; Codehighlighter1_317_322_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   </span><span id="Codehighlighter1_317_322_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 alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_317_322_Open_Text"><span style="color: #000000; background-color: #f5f5f5">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span></span><span style="color: #000000; background-color: #f5f5f5"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />   </span><span style="color: #0000ff; background-color: #f5f5f5">if</span><span style="color: #000000; background-color: #f5f5f5"> ( </span><span style="color: #000000; background-color: #f5f5f5">!</span><span style="color: #000000; background-color: #f5f5f5"> element)<br /> <img id="Codehighlighter1_346_442_Open_Image" onclick="this.style.display='none'; Codehighlighter1_346_442_Open_Text.style.display='none'; Codehighlighter1_346_442_Closed_Image.style.display='inline'; Codehighlighter1_346_442_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_346_442_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_346_442_Closed_Text.style.display='none'; Codehighlighter1_346_442_Open_Image.style.display='inline'; Codehighlighter1_346_442_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   </span><span id="Codehighlighter1_346_442_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 alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_346_442_Open_Text"><span style="color: #000000; background-color: #f5f5f5">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      element </span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5"> document.createElement(tagName);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      element.setAttribute(</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">type</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">, type);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span></span><span style="color: #000000; background-color: #f5f5f5"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />   </span><span style="color: #0000ff; background-color: #f5f5f5">return</span><span style="color: #000000; background-color: #f5f5f5"> element;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />}</span></span><span style="color: #000000; background-color: #f5f5f5"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #0000ff; background-color: #f5f5f5">function</span><span style="color: #000000; background-color: #f5f5f5"> add()<br /> <img id="Codehighlighter1_482_687_Open_Image" onclick="this.style.display='none'; Codehighlighter1_482_687_Open_Text.style.display='none'; Codehighlighter1_482_687_Closed_Image.style.display='inline'; Codehighlighter1_482_687_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_482_687_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_482_687_Closed_Text.style.display='none'; Codehighlighter1_482_687_Open_Image.style.display='inline'; Codehighlighter1_482_687_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span id="Codehighlighter1_482_687_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 alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_482_687_Open_Text"><span style="color: #000000; background-color: #f5f5f5">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff; background-color: #f5f5f5">var</span><span style="color: #000000; background-color: #f5f5f5"> input1 </span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5"> createElement(</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">input</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">,</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">file</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff; background-color: #f5f5f5">var</span><span style="color: #000000; background-color: #f5f5f5"> br </span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5"> document.createElement(</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5"><br /></span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff; background-color: #f5f5f5">var</span><span style="color: #000000; background-color: #f5f5f5"> files </span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5"> document.getElementById(</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">files</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    files.appendChild(br);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    files.appendChild(input1);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="color: #000000; background-color: #f5f5f5"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></span><span style="color: #0000ff"></</span><span style="color: #800000">script</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">head</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">body</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">input </span><span style="color: #ff0000">type</span><span style="color: #0000ff">="button"</span><span style="color: #ff0000"> value</span><span style="color: #0000ff">="add"</span><span style="color: #ff0000"> onclick</span><span style="color: #0000ff">="add();"</span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">div </span><span style="color: #ff0000">id</span><span style="color: #0000ff">="files"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"><</span><span style="color: #800000">input </span><span style="color: #ff0000">type</span><span style="color: #0000ff">="file"</span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">div</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">body</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff"></</span><span style="color: #800000">html</span><span style="color: #0000ff">></span></div> <br /> 延一下,动态创建inputL元素代码片段如下卛_:<br /> <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: #0000ff">function</span><span style="color: #000000"> createElement(tagName,name,type,value)<br /> <img id="Codehighlighter1_48_488_Open_Image" onclick="this.style.display='none'; Codehighlighter1_48_488_Open_Text.style.display='none'; Codehighlighter1_48_488_Closed_Image.style.display='inline'; Codehighlighter1_48_488_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_48_488_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_48_488_Closed_Text.style.display='none'; Codehighlighter1_48_488_Open_Image.style.display='inline'; Codehighlighter1_48_488_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span id="Codehighlighter1_48_488_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_48_488_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">var</span><span style="color: #000000"> element </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000">;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">try</span><span style="color: #000000"> <br /> <img id="Codehighlighter1_87_230_Open_Image" onclick="this.style.display='none'; Codehighlighter1_87_230_Open_Text.style.display='none'; Codehighlighter1_87_230_Closed_Image.style.display='inline'; Codehighlighter1_87_230_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_87_230_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_87_230_Closed_Text.style.display='none'; Codehighlighter1_87_230_Open_Image.style.display='inline'; Codehighlighter1_87_230_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span id="Codehighlighter1_87_230_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_87_230_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        element </span><span style="color: #000000">=</span><span style="color: #000000"> document.createElement('</span><span style="color: #000000"><</span><span style="color: #000000">'</span><span style="color: #000000">+</span><span style="color: #000000">tagName</span><span style="color: #000000">+</span><span style="color: #000000">' name</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">'+name+'</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">/></span><span style="color: #000000">');<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        element.type </span><span style="color: #000000">=</span><span style="color: #000000"> type;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        element.value </span><span style="color: #000000">=</span><span style="color: #000000"> value;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">catch</span><span style="color: #000000"> (e)<br /> <img id="Codehighlighter1_250_256_Open_Image" onclick="this.style.display='none'; Codehighlighter1_250_256_Open_Text.style.display='none'; Codehighlighter1_250_256_Closed_Image.style.display='inline'; Codehighlighter1_250_256_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_250_256_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_250_256_Closed_Text.style.display='none'; Codehighlighter1_250_256_Open_Image.style.display='inline'; Codehighlighter1_250_256_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span id="Codehighlighter1_250_256_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_250_256_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">if</span><span style="color: #000000"> (</span><span style="color: #000000">!</span><span style="color: #000000">element)<br /> <img id="Codehighlighter1_280_467_Open_Image" onclick="this.style.display='none'; Codehighlighter1_280_467_Open_Text.style.display='none'; Codehighlighter1_280_467_Closed_Image.style.display='inline'; Codehighlighter1_280_467_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_280_467_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_280_467_Closed_Text.style.display='none'; Codehighlighter1_280_467_Open_Image.style.display='inline'; Codehighlighter1_280_467_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span id="Codehighlighter1_280_467_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_280_467_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        element </span><span style="color: #000000">=</span><span style="color: #000000"> document.createElement(tagName);<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        element.setAttribute(</span><span style="color: #000000">"</span><span style="color: #000000">type</span><span style="color: #000000">"</span><span style="color: #000000">,type);<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        element.setAttribute(</span><span style="color: #000000">"</span><span style="color: #000000">name</span><span style="color: #000000">"</span><span style="color: #000000">,name);<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        element.setAttribute(</span><span style="color: #000000">"</span><span style="color: #000000">value</span><span style="color: #000000">"</span><span style="color: #000000">,value);<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />   }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />   </span><span style="color: #0000ff">return</span><span style="color: #000000"> element;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"> </span></div> <img src ="http://m.tkk7.com/supercrsky/aggbug/178692.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/supercrsky/" target="_blank">々上善若水?/a> 2008-01-31 16:07 <a href="http://m.tkk7.com/supercrsky/articles/178692.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>标准的动态显C当前时间的JavaScript函数http://m.tkk7.com/supercrsky/articles/177542.html々上善若水?/dc:creator>々上善若水?/author>Thu, 24 Jan 2008 08:56:00 GMThttp://m.tkk7.com/supercrsky/articles/177542.htmlhttp://m.tkk7.com/supercrsky/comments/177542.htmlhttp://m.tkk7.com/supercrsky/articles/177542.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/177542.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/177542.html<script language="javascript" type="text/javascript">
    
function  show_time()
      
{   
          
var today,hour,second,minute,year,month,date,time;
          
          today
=new Date();
      
        year 
= today.getYear();
        month 
= today.getMonth()+1;
        date 
= today.getDate();
        hour 
= today.getHours();
        minute 
=today.getMinutes();
        second 
= today.getSeconds();
        
if(second < 10)
        
{
            time 
= year + "-" + month + "-" + date +" " + hour + ":" + minute + ":0" + second;
        }

        
else
        
{
            time 
= year + "-" + month + "-" + date +" " + hour + ":" + minute + ":" + second;
        }

        document.getElementById(
"time").value = time;
      }
 
     setInterval(show_time,
1000);
</script>
<input type="text" id="time" />

]]>
JavaScript全方位操作Cookiehttp://m.tkk7.com/supercrsky/articles/177344.html々上善若水?/dc:creator>々上善若水?/author>Wed, 23 Jan 2008 10:19:00 GMThttp://m.tkk7.com/supercrsky/articles/177344.htmlhttp://m.tkk7.com/supercrsky/comments/177344.htmlhttp://m.tkk7.com/supercrsky/articles/177344.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/177344.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/177344.html阅读全文

]]>
用javascript实现的tip效果http://m.tkk7.com/supercrsky/articles/168100.html々上善若水?/dc:creator>々上善若水?/author>Sun, 16 Dec 2007 11:55:00 GMThttp://m.tkk7.com/supercrsky/articles/168100.htmlhttp://m.tkk7.com/supercrsky/comments/168100.htmlhttp://m.tkk7.com/supercrsky/articles/168100.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/168100.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/168100.htmldocument.body.onmousemove=quickalt;
document.body.onmouseover
=getalt;
document.body.onmouseout
=restorealt;
var tempalt='';

function getalt(){
    
if(event.srcElement.title && (event.srcElement.title!='' || (event.srcElement.title=='' && tempalt!=''))){
        altlayer.style.left
=event.x;
        altlayer.style.top
=event.y+20;
        altlayer.style.display
='';
        tempalt
=event.srcElement.title;
        tempbg
=event.srcElement.altbg;
        tempcolor
=event.srcElement.altcolor;
        tempborder
=event.srcElement.altborder;
        event.srcElement.title
='';
        altlayer.innerHTML
=tempalt;
        
if (typeof(tempbg)!="undefined"){altlayer.style.background=tempbg}else{altlayer.style.background="infobackground"}
        
if (typeof(tempcolor)!="undefined"){altlayer.style.color=tempcolor}else{altlayer.style.color=tempcolor="infotext"}
        
if (typeof(tempborder)!="undefined"){altlayer.style.border='1px solid '+tempborder;}else{altlayer.style.border='1px solid #000000';}
    }

}

function quickalt(){
    
if(altlayer.style.display==''){
        altlayer.style.left
=event.x;
        altlayer.style.top
=event.y+10;
    }

}

function restorealt(){
    event.srcElement.title
=tempalt;
    tempalt
='';
    altlayer.style.display
='none';
}

q个得加?lt;/body>l束标签的前?br />
<body>
<span title="不错?>默认效果</span>

<div style="display:none;border:1px solid #000000;background-color:#FFFFCC;font-size:12px;position:absolute;padding:2;" id=altlayer></div>
<!--注意q个引入必须在下?->
<script type="text/javascript" src="../js/tip.js"></script>
</body>
q里面的效果层就是这个div.
在想要应?tip的文字上面加?lt;span></span>标签卛_

]]>
验证表单的标准JavaScripthttp://m.tkk7.com/supercrsky/articles/165693.html々上善若水?/dc:creator>々上善若水?/author>Thu, 06 Dec 2007 00:11:00 GMThttp://m.tkk7.com/supercrsky/articles/165693.htmlhttp://m.tkk7.com/supercrsky/comments/165693.htmlhttp://m.tkk7.com/supercrsky/articles/165693.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/165693.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/165693.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    
<head>
        
<meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
        
<title>Untitled Document</title>
        
<script type="text/javascript">
            
function validate(m,n)
            
{
                
var flag = true;
                
if(m.value == "" && n == 0)
                
{
                    document.getElementById(
"username_info").innerHTML = "用户名不I?/span>";
                    flag 
= false;
                }

                
else
                
{
                    document.getElementById(
"username_info").innerHTML = "";
                }

                
if(m.value.length < 6 && n == 0)
                
{
                    document.getElementById(
"username_info").innerHTML = "用户名长度不能小?";
                    flag 
= false;
                }

                
else
                
{
                    document.getElementById(
"username_info").innerHTML = "";
                }

                
if(m.value == "" && n == 1)
                
{
                    document.getElementById(
"password_info").innerHTML = "密码不能为空";
                    flag 
= false;
                }

                
else
                
{
                    document.getElementById(
"password_info").innerHTML = "";
                }

                
if(m.value.length < 6 && n == 1)
                
{
                    document.getElementById(
"password_info").innerHTML = "密码长度不能于6";
                    flag 
= false;
                }

                
else
                
{
                    document.getElementById(
"password_info").innerHTML = "";
                }

                
return flag;
                
            }

        
</script>
    
</head>
    
<body>
        
<div align="center">
            
<form>
                
<input type="text" id="username" onblur="validate(this,0);"/><div id="username_info"></div>
                
<br/>
                
<input type="password" id="password" onblur="validate(this,1);"/><div id="password_info"></div>
                
<br/>
                
<input type="submit" value="验证" /><input type="reset" value="重置"/>
                
<br/>
            
</form>
        
</div>
    
</body>
</html>


]]>
javascript去除字符串空格的函数http://m.tkk7.com/supercrsky/articles/164740.html々上善若水?/dc:creator>々上善若水?/author>Sun, 02 Dec 2007 17:59:00 GMThttp://m.tkk7.com/supercrsky/articles/164740.htmlhttp://m.tkk7.com/supercrsky/comments/164740.htmlhttp://m.tkk7.com/supercrsky/articles/164740.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/164740.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/164740.htmlfunction jtrim(s)  
{  
  
var i,b=0,e=s.length;  
  
for(i=0;i<s.length;i++//dI格 
     if(s.charAt(i)!=' '){b=i;break;}  
   
if(i==s.length)  
    
return "";  

  
for(i=s.length-1;i>b;i--) dI格 
    
if(s.charAt(i)!=' '){e=i;break;}  
 
return s.substring(b,e+1);  
}
 
下面的更好点:
//dI格; 
function ltrim(s)
return s.replace( /^\s*/""); 
}
 
//dI格; 
function rtrim(s)
return s.replace( /\s*$/""); 
}
 
//d右空? 
function trim(s)
return rtrim(ltrim(s)); 
}
 


]]>
响应回R和判断是否ؓ数字的函?可用于分?http://m.tkk7.com/supercrsky/articles/164692.html々上善若水?/dc:creator>々上善若水?/author>Sun, 02 Dec 2007 12:29:00 GMThttp://m.tkk7.com/supercrsky/articles/164692.htmlhttp://m.tkk7.com/supercrsky/comments/164692.htmlhttp://m.tkk7.com/supercrsky/articles/164692.html#Feedback0http://m.tkk7.com/supercrsky/comments/commentRss/164692.htmlhttp://m.tkk7.com/supercrsky/services/trackbacks/164692.html<script language="javascript" type="text/javascript">
//分页处理函数
function check()
{
   
// 响应回R
   if(event.keyCode == 13)
   
{
      
var currentPage = document.getElementById("currentPage");
      
var totalPage = document.getElementById("totalPage");
      
var flag = true;
      
if(isNaN(currentPage.value))
      
{
         alert('误入数?);
         currentPage.value 
= "";
         currentPage.focus();  
         
return false;
        
      }

      
else
      
{
           
//处理输入大于总页?/span>
           if(currentPage.value > totalPage.value)
               currentPage.value 
= totalPage.value;
           
//处理数或负?/span>
           if(currentPage.value <= 0)
               currentPage.value 
= 1;
           
//跌{
         window.location = "user.action?currentPage=" + currentPage.value;
         currentPage.focus(); 
         
return true;
      }

   }

}

</script>
<input type="text" name="currentPage" size="2" onkeydown="return check();"/> 
            
<!-- 保存总页?用于javascript处理分页 -->
            
<input type="hidden" id="totalPage" value="<s:property value="#page.totalPage"/>" />
其中的totalPage是通过分页cȝ出来?

]]>
վ֩ģ壺 þҹɫƷ| պӰ| ޾Ʒҹר| Ƶվ߿| Ʒպһ| avӰѿ| ˳ۺ7777| һëƬѲ| һ| ܳƵѹۿ| ŮƵַ| 99þֻƷ| ҹþþþС˵| ѻɫappվ| ĻƷƵ| þþþAV| ߾Ʒѹۿ| ޾ƷŮƵ| ձѸƵ| þþþþùaѹۿ| vavavaþ| Ůcaoվѿ߿| ޾ƷӰ| ձĻ߿| eeussӰԺwww| վ߹ۿ| ֻѸۿ| ƷþþþþĻ| ۺվɫɫ| þþžѾƷ6| ĻŮ| ҹƬ߹ۿӰԺ| պһѸ| õӰ߹ۿ| AVƬ| Ƶ| һ͵| ޾Ʒ벻߲HE| Ƭ뿴| ƵѲ | 99߹ۿƵվ|