Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javascript º¯Êý ºÍ CustomValidator¿Ø¼þÏà½áºÏʹÓÃ

<asp:TextBox ID="txtPwdPrompt" runat="server"></asp:TextBox>
<asp:CustomValidator id="CVPwdPrompt" runat="server" ClientValidationFunction="CheckPwd" ControlToValidate="txtPwdPrompt" ErrorMessage="<span style='font:12px'>ÌáʾÎÊÌâ±ØÐëÔÚ2-50¸ö×Ö·ûÄÚ</span>" Display="None"></asp:CustomValidator>
Javascriptº¯Êý:
<script language="javascript" type="text/javascript">
function CheckPwd(source, arguments)
{
   if(arguments.Value.Length>2 || arguments.Value.Length < 50)
   {
     arguments.IsValid=true;
   }
   else
   {
     arguments.IsValid =false;
   }
}
</script>
º¯ÊýÓÐÁ½¸ö²ÎÊý:
source ²ÎÊýÊǶÔΪ CustomValidator ¿Ø¼þ³ÊÏÖµÄ <span> ÔªËصÄÒýÓá£Òò´Ë£¬Äú¿ÉÒÔ±à³ÌµÄ·½Ê½¿ØÖÆ <span> ±ê¼Ç£¬ÈçÐÞ¸Ä InnerHtml ÊôÐÔ¡£
arguments ²ÎÊýÊÇÒ»¸ö¾ßÓÐÒÔÏÂÁ½¸öÊôÐԵĶÔÏó£ºValue ºÍ IsValid¡£Ê¹Óô˲ÎÊý¿ÉÒÔ»ñÈ¡¿Ø¼þµÄÖµ£¬ÒÔ¸ù¾Ý×Ô¶¨ÒåÑéÖ¤Àý³ÌÑéÖ¤²¢Ö¸Ê¾¸ÃÖµÊÇ·ñÓÐЧ¡£
      ʹÓà ClientValidationFunction ÊôÐÔÖ¸¶¨Óë CustomValidator ¿Ø¼þ¹ØÁªµÄ¿Í»§¶ËÑéÖ¤½Å±¾º¯ÊýµÄÃû³Æ¡£ÓÉÓڸýű¾º¯ÊýÔÚ¿Í»§¶ËÖ´ÐУ¬Òò´Ë¸Ãº¯Êý±ØÐëʹÓÃÄ¿±êä¯ÀÀÆ÷Ö§³ÖµÄÓïÑÔ£¨Èç VBScript »ò JScript£©À´±àд¡£
Óë·þÎñÆ÷¶ËÑéÖ¤Ò»Ñù£¬¿ÉÒÔͨ¹ýʹÓà arguments ²ÎÊýµÄ Value ÊôÐÔÀ´·ÃÎÊÒªÑéÖ¤µÄÊäÈë¿Ø¼þÖеÄ×Ö·û´®¡£Í¨¹ýÉèÖà arguments ²ÎÊýµÄ IsValid ÊôÐÔ·µ»ØÑéÖ¤½á¹û¡£
×¢Òâ:ValueÊ××Öĸ±ØÐë´óд ......


Ïà¹ØÎĵµ£º

JavaScriptµÄwithÓï¾ä


withÓï¾ä
    ÓÃÓÚÉèÖôúÂëÌض¨¶ÔÏóµÄ×÷ÓÃÓò¡£
    Àý£º
        var sMessage = "hello world";
        with(sMessage)
        {
         &nbs ......

JavaScriptµÄº¯Êý


º¯Êý
    ¼´Ê¹º¯ÊýȷʵÓзµ»ØÖµ£¬Ò²²»±ØÃ÷È·µØÉùÃ÷Ëü¡£¸Ãº¯ÊýÖ»ÐèҪʹÓÃreturnÔËËã·ûºó¸úÒª·µ»ØµÄÖµ¼´¿É¡£
    Àý£º
        function sum(iNum1, iNum2)
        {
           ......

Àí½âjavascriptÖÐarguments,callee,caller


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312"> 
<head> 
<head> 
<title> ¹ØÓÚarguments,callee,callerµÈµÄ²âÊÔ &l ......

JavaScript¶ÁÈ¡TxtÎļþ

JavaScript¶ÁÈ¡TxtÎļþ
<html>
<head>
<title>new page</title>
<script>
 GetHeader(src) {
var ForReading=1;
var fso=new ActiveXObject("Scripting.FileSystemObject");
var f=fso.OpenTextFile(src,ForReading);
return(f.ReadAll());
}
var arr=GetHe ......

javascript ¶¯Ì¬´´½¨±í¸ñ£ºÐÂÔö¡¢É¾³ýÐк͵¥Ôª¸ñ


ÀûÓÃjsÀ´¶¯Ì¬´´½¨±í¸ñÓÐÁ½ÖÖ¸ñʽ£¬appendChild()ºÍinsertRow¡¢insertCell()¡£Á½ÖÖ·½Ê½Æäʵ²î²»¶à£¬µ«µÚÒ»ÖÖÓпÉÄÜÔÚIEÉÏÓÐÎÊÌ⣬ËùÒÔÍƼö´ó¼ÒʹÓõڶþÖÖÁË£¬Ö±½Ó˵°É¡£
1¡¢inserRow()ºÍinsertCell()º¯Êý
insertRow()º¯Êý¿ÉÒÔ´ø²ÎÊý£¬ÐÎʽÈçÏ£º
insertRow(index)£ºindex´Ó0¿ªÊ¼
Õâ¸öº¯Êý½«ÐÂÐÐÌí¼Óµ½indexµÄÄÇһР......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ