001、获取滚动条滚动的距离
var sTop = document.documentElement.scrollTop || document.body.scrollTop 002、获取非行间样式IE: currentStyle[attr]标准: getComputedStyle[attr]function getStyle(obj,attr){ if(obj.currentStyle){ return obj.currentStyle[attr]}else{ return getComputedStyle(obj,false)[attr];}} 003、获取事件对象var e = e || event; 004获取键盘信息e.keyCode || e.which 005阻止浏览器的默认行为function prevent(e){ if(e.preventDefault){ e.preventDefault();}else{ e.returnValue = false;}} 006阻止事件冒泡e.stopPropagation?e.stopPropagation():e.cancelBubble = true; 007事件监听addEventListener()attachEvent() 008事件解绑removeEventListener()detachEvent()009获取事件源e.target || e.srcElement; 010ajax兼容var xhr = new XMLHttpRequest() || new ActiveXObject("Microsoft,XMLHTTP");