如何在页面上同时作两件事情,java中可以使用多线程的方式,javascript或jsp中可不可以这么作,或者有更好的方法? javascript没有多线程,只能用timer来模拟 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <body><div id="ice" style="color:#F60">10000</div></body><script language="javascript"><!--function timer(target){ this.time = 10000; this.target = target; this.run = function(){ this.time++; this.target.innerHTML = this.time; var me = this; this.tm = setTimeout( function(){me.run();}, 1 ); } this.stop = function(){if(this.tm)clearTimeout(this.tm)};}var $=document.getElementById;var t = new timer($('ice'));//--></script><input type="button" value="run" onclick="t.run()"/><input type="button" value="stop" onclick="t.stop()"/> 查看 emu 的贴子,他有专贴研究JS的多线程 js如何让文本框过滤<>括号呢? 这里有一段JS验证脚本帮忙解释下代表什么意思 js快速光亮选中textarea中特定区域然后替换问题。 asp.net 时间框问题 谁帮我分析下这段JS代码 这种效果 怎么才能一个一个的实现 获取当前页面的width height 急急 关于按钮的问题!在线等!谢谢! 如何用脚本动态的生成一个新网页? 怎样限制注册文本框中不能包含指定内容? javascript改变字体颜色粗细问题 紧急求助:高手们进来看看。
<script language="javascript">
<!--
function timer(target){
this.time = 10000;
this.target = target;
this.run = function(){
this.time++;
this.target.innerHTML = this.time;
var me = this;
this.tm = setTimeout( function(){me.run();}, 1 );
}
this.stop = function(){if(this.tm)clearTimeout(this.tm)};
}
var $=document.getElementById;
var t = new timer($('ice'));
//-->
</script>
<input type="button" value="run" onclick="t.run()"/>
<input type="button" value="stop" onclick="t.stop()"/>