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

Javascript: setTimeout()ʹÓü° setInterval()ʹÓÃ

Evaluates an expression after a specified number of milliseconds has elapsed.
(ÔÚÖ¸¶¨Ê±¼ä¹ýºóÖ´ÐÐÖ¸¶¨µÄ±í´ïʽ)
Syntax:
iTimerID = window.setTimeout(vCode, iMilliSeconds [, sLanguage])
Parameters
vCode
Required. Variant that specifies the function pointer or string that indicates the code to be executed when the specified interval has elapsed.
iMilliSeconds
Required. Integer that specifies the number of milliseconds.
sLanguage
Optional. String that specifies one of the following values:
JScript
Language is JScript.
VBScript
Language is VBScript.
JavaScript
Language is JavaScript.
Return Value
Integer. Returns an identifier that cancels the evaluation with the clearTimeout method.
==============================================================
ÒÔÉÏÄÚÈÝÕª×Ôij±¾JScript½Ì³Ì(CHM¸ñʽ,³ö´¦²»Ïê,¸úÔ­×÷Õß˵ÉùSorry)
ÒÔÏÂÄÚÈÝû³­ÈκÎÈ˵Ä,Èç¹ûÓÐÀ×ͬ,¹À¼Æ²»ÊÇÄ㳭żµÄ¾ÍÊÇÇɺÏ,ºÙºÙ.
-------------------------------------------------------------------
setTimeout( alert("3ÃëÖÖ¹ýÈ¥ÁË"), 3000);//µ÷ÓÃÒ»¸öº¯Êý,ÔÊÐí´ø³£Á¿²ÎÊý
-------------------------------------------------------------------
<script language="Javascript">
//by zuoyang
var x = 1;
var y = 2;
var z = 3;
var sum;
function Plus(a, b)
{
          var z = 0;
          var i = 0;
          for (i = 0; i < arguments.length; i++)
          {
                   z += arguments[i];
          }
          setTimeout( function() {alert(z);}, 6000); //¿ÉÒÔ´ø±äÁ¿²ÎÊýµÄsetTimeoutµ÷ÓÃÐÎʽ
          return z;
}
setTimeout( function(){ sum = Plus(x, y, z); }, 3000);/*³ýÁË¿ÉÒÔ´ø±äÁ¿²ÎÊý»¹¿ÉÒÔ»ñÈ¡·µ


Ïà¹ØÎĵµ£º

javascript¼¼ÇÉ×Öµä

ÿһÏî¶¼ÊÇjsÖеÄС¼¼ÇÉ£¬µ«Ê®·ÖµÄʵÓã¡
1.document.write(""); Êä³öÓï¾ä
2.JSÖеÄ×¢ÊÍΪ//
3.´«Í³µÄHTMLÎĵµË³ÐòÊÇ:document->html->(head,body)
4.Ò»¸öä¯ÀÀÆ÷´°¿ÚÖеÄDOM˳ÐòÊÇ:window->(navigator,screen,history,location,document)
5.µÃµ½±íµ¥ÖÐÔªËØµÄÃû³ÆºÍÖµ:document.getElementById("±íµ¥ÖÐÔªËØµÄ ......

JavaScript½øÐÐGETºÍPOSTÇëÇó

JavaScript½øÐÐGETºÍPOSTÇëÇó
WebÉÏ×î³£¼ûµÄÇëÇó¾ÍÊÇGETÇëÇó.ÿ´ÎÔÚä¯ÀÀÆ÷ÖÐÊäÈëURL²¢´ò¿ªÒ²Ã×ÄÉÊÐ,¾ÍÊÇÔÚÏò·þÎñÆ÷·¢ËÍÒ»¸öGETÇëÇó.
GETÇëÇó£º
GETÇëÇóµÄ²ÎÊýʹÓÃÎʺÅ×·¼Óµ½URLµÄ½áβ,ºóÃ×ÄɸøÕâÓÃ&ºÃÁ¬½ÓÆðÀ´µÄÃû³Æ/Öµ.ÀýÈç:
http://www.somewhere.com/page.php?name1=value1&name2=value2&name3=value3
......

JavaScript¾«´â¶ÁÊé±Ê¼Ç(8)

µÚ8Õ  ·½·¨
JavaScript°üº¬ÁËÉÙÁ¿¿ÉÓÃÔÚ±ê×¼ÀàÐÍÉϵıê×¼·½·¨¡£
Array
array.concat(item…)
concat·½·¨·µ»ØÒ»¸öÐÂÊý×飬Ëü°üº¬arrayµÄdz¸´ÖÆ(shallow copy)²¢½«1¸ö»ò¶à¸ö²ÎÊýitem¸½¼ÓÔÚÆäºó¡£Èç¹û²ÎÊýitemÊÇÒ»¸öÊý×飬ÄÇôËüµÄÿ¸öÔªËØ»á±»·Ö±ðÌí¼Ó¡£´ËÍ⣬Çë²Î¼û±¾ÕºóÃæµÄarray.push(item…)·½·¨¡ ......

javaScriptµÄcalleeÊôÐÔ

      jsµÄFunction¶ÔÏóÔÚµ÷Óùý³ÌÖоßÓÐÒ»¸öarguomentsÊôÐÔ£¬ËüÊÇÓɽű¾½âÊÍÆ÷´´½¨µÄ£¬ÕâÒ²ÊÇ´´½¨arguments¶ÔÏóΨһ;¾¶¡£arguments¶ÔÏó¿ÉÒÔ¿´×öÊÇÒ»¸öArray¶ÔÏó£¬Ëü¾ßÓÐlengthÊôÐÔ£¬¿ÉÒÔͨ¹ýÐòºÅ·ÃÎÊÿһ¸ö²ÎÊý¡£¶øÇÒ£¬Í¨¹ýarguments µÄcalleeÊôÐÔ¿ÉÒÔ»ñÈ¡¶ÔÖ»ÔÚÖ´ÐеÄFunction¶ÔÏóµÄÒýÓã¬ÈçÏ ......

JavaScript³£ÓÃÑéÖ¤º¯Êý

JavaScript³£ÓÃÑéÖ¤º¯Êý
Òý×Ô:http://www.webdeveloping.cn/blog/?action=show&id=209
 //УÑéÊÇ·ñÈ«ÓÉÊý×Ö×é³É      
 function isDigit(s) {      
  var patrn=/^[0-9]{1,20}$/;      
  i ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ