易截截图软件、单文件、免安装、纯绿色、仅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.
==============================================================
以上内容摘自某本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实现像java、c#之类的sleep暂停的函数功能

我们都知道java、c#、vb等语言都有sleep暂停的函数,而JavaScript脚本没有类似的功能。
下面就是我的实现的方法:
<mce:script type="text/javascript"><!--
function test()
{
var s="javascript--暂停函数";
setTimeout(
function(){
eval(sleep(test)); //执行return之后的代码,也就是&ldq ......

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 判断文件是否存在

1. 客户端 //主要针对本地IE浏览器访问
<script
language="javascript">
function FileExist()
{
     var sfso=new
ActiveXObject("Scripting.FileSystemObject");
     var fPath="[The path of the
file]";
     if(sfso.FileExists(fP ......

JavaScript获取当前文件全路径、当前目录、当前文件名

//获取当前文件全路径
<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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号