{infiniteZest}
// Articles. Tutorials. Utilities.
Home  |   Search  |   Login  
Categories Skip Navigation Links
New / All
AJAX
Apple
ASP.NET
.NET
Git
Google / Android
Python / IronPython
Miscellaneous
SQL Server
AJAX Source Viewer
View the source code of a Method from ASP.NET AJAX Library. Choose a method from the menu items above (Namespaces, Classes, or Methods).
Method 'removeHandler(element, eventName, handler)'
Method: removeHandler(element, eventName, handler)
Method Full Name:     Sys$UI$DomEvent$removeHandler(element, eventName, handler)
Class: DomEvent
Namespace: Sys.UI
Source File: MicrosoftAjax.debug.js
1   var $removeHandler = Sys.UI.DomEvent.removeHandler = function Sys$UI$DomEvent$removeHandler(element, eventName, handler) {
2     /// <summary locid="M:J#Sys.UI.DomEvent.removeHandler" />
3     /// <param name="element"></param>
4     /// <param name="eventName" type="String"></param>
5     /// <param name="handler" type="Function"></param>
6     var e = Function._validateParams(arguments, [
7     {name: "element"},
8     {name: "eventName", type: String},
9     {name: "handler", type: Function}
10    ]);
11    if (e) throw e;
12    Sys.UI.DomEvent._ensureDomNode(element);
13    var browserHandler = null;
14    if ((typeof(element._events) !== 'object') || (element._events == null)) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
15    var cache = element._events[eventName];
16    if (!(cache instanceof Array)) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
17    for (var i = 0, l = cache.length; i < l; i++) {
18      if (cache[i].handler === handler) {
19        browserHandler = cache[i].browserHandler;
20        break;
21      }
22    }
23    if (typeof(browserHandler) !== 'function') throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
24    if (element.removeEventListener) {
25      element.removeEventListener(eventName, browserHandler, false);
26    }
27    else if (element.detachEvent) {
28      element.detachEvent('on' + eventName, browserHandler);
29    }
30    cache.splice(i, 1);
31  }
This is the JavaScript source for method removeHandler(element, eventName, handler) from ASP.NET AJAX Library. Full name for this method is Sys$UI$DomEvent$removeHandler(element, eventName, handler). It belongs to the class DomEvent, which is in Sys.UI namespace. This source is in MicrosoftAjax.debug.js file.
Bookmark and Share This
About  Contact  Privacy Policy  Site Map