js能否实现暂停浏览器执行,类似于隐性的alert window.setTimeout("a()",5000);//5000毫秒(即5秒)后执行函数a() 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 setTimeout()不能暂停链接点击后的跳转。 IE测试通过:<html><head><title>new page</title><script>var src="";function setDelayTime(obj){src=obj.src;window.setTimeout("show()",5000);//5000毫秒后执行函数a()}function show(){window.location=src;}</script></head><body><a src="http://www.baidu.com" onclick="setDelayTime(this)">点击这里5秒后跳转页面</a></body></html> lz不好意思,有点错误<html><head><title>new page</title><script>var src="";function setDelayTime(obj){src=obj.src;window.setTimeout("show()",5000);//5000毫秒后执行函数a()}function show(){window.location=src;}</script></head><body><a href="http://www.baidu.com" onclick="javascript:this.src=this.href;this.href='#';setDelayTime(this)">点击这里5秒后跳转页面</a></body></html> <html><head></head><body> <input type="button" name="show" value="show" onClick="delay();"></body><script language="javascript">function show(){ window.location="http://www.china.com";}function delay(){ setTimeout("show()",5000)}</script></html> 你是说类似php的sleep()吧很明确的告诉你,不行这类问题已经讨论过N遍了在IE不假死的情况下无法实现暂停JS脚本 感谢大家,虽然不能实现sleep()不过lihui_shine(浪尖赏花)的方法实现了我需要的一些功能,感谢!~ jQuery easyui的combobox问题 访qq的浏览器右下角显示提示窗口的实现 javascript实现设置select下拉列表框中选中内容。 [100分],求:按住鼠标左键滑过表格,表格的单元格或行响应什么事件?在线,对了立即给分. 请问网易的新闻自动切换是怎样做的??? 再问正则表达式问题 请教~! window.open或onload的问题,在线等待 请教一下对于table的单元格元素进行zclip时,有问题,触发不了复制事件! 判断考试成绩等级。 Css换皮技术的方式? DIV相对定位问题
<html>
<head>
<title>new page</title>
<script>
var src="";
function setDelayTime(obj){
src=obj.src;
window.setTimeout("show()",5000);//5000毫秒后执行函数a()
}
function show(){
window.location=src;
}
</script>
</head>
<body>
<a src="http://www.baidu.com" onclick="setDelayTime(this)">点击这里5秒后跳转页面</a>
</body>
</html>
<head>
<title>new page</title>
<script>
var src="";
function setDelayTime(obj){
src=obj.src;
window.setTimeout("show()",5000);//5000毫秒后执行函数a()
}
function show(){
window.location=src;
}
</script>
</head>
<body>
<a href="http://www.baidu.com" onclick="javascript:this.src=this.href;this.href='#';setDelayTime(this)">点击这里5秒后跳转页面</a>
</body>
</html>
<head>
</head>
<body>
<input type="button" name="show" value="show" onClick="delay();">
</body>
<script language="javascript">
function show()
{
window.location="http://www.china.com";
}
function delay()
{
setTimeout("show()",5000)
}</script>
</html>
很明确的告诉你,不行
这类问题已经讨论过N遍了
在IE不假死的情况下无法实现暂停JS脚本