会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
一他糊涂
擅长技术,但不限于技术 从管理再回到技术
博客园
首页
新随笔
联系
订阅
管理
javascript中用函数属性实现函数调用计数
<
script
>
test.counter
=
0
;
function
test(a,b,c)
{
test.counter
++
;
alert(test.counter);
}
setTimeout(
"
alert(test.counter)
"
,
5000
);
<
/
script>
<
/
HEAD>
<
BODY
>
<
a href
=
"
javascript:void window.open();
"
>
link
<
/
a>
<
input type
=
button value
=
"
test
"
onclick
=
"
javascript:test();
"
>
test.counter为函数属性,函数每被调用一次,计数加一。
但还不明白函数属性和全局变量有啥不一样?
貌似一样。。。。。。
posted @
2008-02-01 18:24
jacktu
阅读(
1206
) 评论(
3
)
收藏
举报
刷新页面
返回顶部
公告