Created
June 2, 2012 12:01
-
-
Save xhinking/2858045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
function addEventSimple(obj,evt,fn){ | |
if(obj.addEventListener){ | |
obj.addEventListener(evt,fn,false); | |
}else if(obj.attachEvent){ | |
obj.attachEvent('on'+evt,fn); | |
} | |
} | |
addEventSimple(window,'load',init); | |
function init(){ | |
addEventSimple(document,'click',clickFunc); | |
} | |
function clickFunc(e){ | |
// do some thing here.. | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment