下面这段js代码里面怎么释放变量?避免内存泄露?

timeout=60;
count=0;
current=location.href;
setTimeout('reload()',1000*timeout);
function reload(){
count=count+1
console.log(count)
setTimeout('reload()',1000*timeout);
fr4me='<frameset cols='*'>n<frame src=''+current+''/>';
fr4me+='</framesset>';
with(document){write(fr4me);void(close())};
}

上面这段代码,每隔一分钟刷新下当前页面,内存一直在增涨,没有释放

阅读 1.4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题