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(浪尖赏花)的方法实现了我需要的一些功能,感谢!~ 有能力你就来!JS效果高分求方法! 一个javacript小程序的问题 对象不支持此属性或方法错误的原因都有什么 js如何实现tab异步加载。 请问选项丢失的问题? 求几个比较好的Web前端开发类的网址? 100分打听一js日历控件的名字 JavaScript文本读取 html模板 怎么弄 用什么方法在jsp页面里做个打印按钮就可以控制这个页面纸张大小和页边距? 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脚本