怎么才能catch setTimeout抛出的异常 本帖最后由 nongfusq 于 2011-01-27 19:33:33 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 搞一个类似代理的函数调用目标函数,在代理函数中捕获。<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script>function Test() {setTimeout(proxyTarget,3)} function proxyTarget(){ try{ target(); }catch(e){ alert("异常"+e); }}function tagert(){ throw "xxx"}</script></head><body><input type="button" value="start" onclick="Test()" /></body></html> 直接在匿名函数里catch不就行了? window.onerror=function(ex){ alert(ex);} 关于url转换or计算(不知道具体方法) 进贴查看描述 文档碎片中的元素的祖先节点的类型是1还是9啊 菜鸟求助(滑动门问题)! 前台jsp页面接收参数 转型的问题 小弟谢过了先 高人请进~ 看看一个Bt问题 firefox 下如何删除cookie 一个关于 eWebEditor 默认字体的问题 图片路径对,但是在有的浏览器下中间的图片就是显示不出来 js中变量可以存图片么 如何在js中获得表单中动态的文本框内的内容? select ext desktop怎样隐藏父窗口
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
function Test() {
setTimeout(proxyTarget,3)
}
function proxyTarget(){
try{
target();
}catch(e){
alert("异常"+e);
}
}
function tagert(){
throw "xxx"
}</script>
</head>
<body>
<input type="button" value="start" onclick="Test()" />
</body>
</html>
alert(ex);
}