javascript 之 定时器setInterval
function startTimer(){
timer= setInterval("alert('定时器测试')",1000); //1秒执行一次
}
function stopTimer(){
clearInterval(timer);
}
javascript:后退并刷新页面
<BODY οnlοad="window.history.back().location.reload()">
计算字符数
var i=0;
function String.prototype.lenB(){return this.replace(/[^/x00-/xff]/g,"**").length;}
function count(n,AreaName,TextName) //统计字节数
{
var s =document.all[AreaName].value;
s = s.replace(/(/r/n)(/r/n)/g,"/n");
if(n==1){
document.all[TextName].innerHTML=""+s.length+"";
}
else{
document.all[TextName].innerHTML=""+s.lenB()+"";
}
}