source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/BMX41000/IHS BMX Framework/IndianHealthService.BMXNet.Doc/Help/Scripts/EventUtilities.js

Last change on this file was 1146, checked in by Sam Habiel, 14 years ago

Initial Import of BMX4

File size: 685 bytes
Line 
1
2 // attach a handler to a particular event on an element
3 // in a browser-independent way
4 function registerEventHandler (element, event, handler) {
5 if (element.attachEvent) {
6 // MS registration model
7 element.attachEvent('on' + event, handler);
8 } else if (element.addEventListener) {
9 // NN (W4C) regisration model
10 element.addEventListener(event, handler, false);
11 } else {
12 // old regisration model as fall-back
13 element[event] = handler;
14 }
15 }
16
17 // get a delegate that refers to an instance method
18 function getInstanceDelegate (obj, methodName) {
19 return( function(e) {
20 e = e || window.event;
21 return obj[methodName](e);
22 } );
23 }
Note: See TracBrowser for help on using the repository browser.