[prev in list] [next in list] [prev in thread] [next in thread]
List: kupu-checkins
Subject: [kupu-checkins] r5406 - kupu/trunk/kupu/common
From: guido () codespeak ! net
Date: 2004-06-30 10:59:51
Message-ID: 20040630105951.AE0F25B260 () thoth ! codespeak ! net
[Download RAW message or body]
Author: guido
Date: Wed Jun 30 12:59:51 2004
New Revision: 5406
Modified:
kupu/trunk/kupu/common/kupuhelpers.js
Log:
Added some code to make an alert appear when registering an event handler
fails. Hopefully this makes tracking integration problems easier.
Modified: kupu/trunk/kupu/common/kupuhelpers.js
==============================================================================
--- kupu/trunk/kupu/common/kupuhelpers.js (original)
+++ kupu/trunk/kupu/common/kupuhelpers.js Wed Jun 30 12:59:51 2004
@@ -75,13 +75,17 @@
function addEventHandler(element, event, method, context) {
/* method to add an event handler for both IE and Mozilla */
var wrappedmethod = new ContextFixer(method, context);
- if (_SARISSA_IS_MOZ) {
- element.addEventListener(event, wrappedmethod.execute, false);
- } else if (_SARISSA_IS_IE) {
- element.attachEvent("on" + event, wrappedmethod.execute);
- } else {
- throw "Unsupported browser!";
- }
+ try {
+ if (_SARISSA_IS_MOZ) {
+ element.addEventListener(event, wrappedmethod.execute, false);
+ } else if (_SARISSA_IS_IE) {
+ element.attachEvent("on" + event, wrappedmethod.execute);
+ } else {
+ throw "Unsupported browser!";
+ };
+ } catch(e) {
+ alert('exception ' + e.message + ' while registering an event handler for \
element ' + element + ', event ' + event + ', method ' + method); + };
};
function removeEventHandler(element, event, method) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic