没有合适的资源?快使用搜索试试~ 我知道了~
最常用的10个javascript自定义函数(english)
需积分: 9 1 下载量 49 浏览量
2012-07-26
21:21:40
上传
评论
收藏 47KB DOC 举报
温馨提示
试读
7页
If there was ever a universal common.js shared among the entire develosphere, you’d fine these ten (plus one bonus) functions. It would be the swiss army knife no developer would go into production without. They have no doubt been tested tried and true and have proven usefulness and helpfulness to all those who’ve used them. So without further ado, here are what I believe to the top ten greatest custom JavaScript functions in use today.
资源详情
资源评论
资源推荐
If there was ever a universal common.js shared among the entire
develosphere, you’d ne these ten (plus one bonus) functions. It
would be the swiss army knife no developer would go into
production without. They have no doubt been tested tried and true
and have proven usefulness and helpfulness to all those who’ve
used them. So without further ado, here are what I believe to the
top ten greatest custom JavaScript functions in use today.
Upon further reading this article, it is suggested that for this article
in particular the reader should use an alternate style with cleaner
whitespace and larger margins. This is available by selecting Clean
with Whitespace available on the side bar.
10) addEvent()
Surely a staple to event attachment! Regardless to what version you
use written by whatever developer, it does what it says it does. And
of course as you might of known, I’ve put together quite a handy
version myself recently of addEvent() with some help from the
contest winner and Mark Wubben along with a few minor syntax
adjustments. But just to be fair to Scott Andrew, here is the original
that started it all.
Scott Andrew’s original addEvent() function
function addEvent(elm, evType, fn, useCapture) {
if (elm.addEventListener) {
elm.addEventListener(evType, fn, useCapture);
return true;
}
else if (elm.attachEvent) {
var r = elm.attachEvent('on' + evType, fn);
return r;
}
else {
elm['on' + evType] = fn;
}
}
9) addLoadEvent()
leiyuwuhench
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0