From eb8e524bd7df4c0d86919b90d14c25a1474188b2 Mon Sep 17 00:00:00 2001 From: Salvador Zaragoza Rubio Date: Mon, 14 Mar 2011 09:48:30 +0100 Subject: [PATCH] Bug 5862 - Incompatibility in ajax.js with "localName" for Internet Explorer It has been detected an incompatibility with Internet Explorer in the ajax.js file that cause a javascript error for this browser that prevents proper operation. The error occurs because the "localName" is not supported by Internet Explorer and returns "undefined". Bug 5862 - Incompatibility in ajax.js with "localName" for Internet Explorer Fix error on comma for IE --- koha-tmpl/intranet-tmpl/prog/en/js/ajax.js | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/ajax.js b/koha-tmpl/intranet-tmpl/prog/en/js/ajax.js index 95d59e7..dfc0444 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/ajax.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/ajax.js @@ -7,7 +7,7 @@ KOHA.AJAX = { cache: false, dataType: 'json', type: 'POST', - error: function ( xhr, stat, error ) { KOHA.AJAX.BaseError( error_callback, xhr, stat, error ) }, + error: function ( xhr, stat, error ) { KOHA.AJAX.BaseError( error_callback, xhr, stat, error ) } } ); $.ajax( options ); }, @@ -37,7 +37,9 @@ KOHA.AJAX = { .attr( 'disabled', 'disabled' ) .each( function () { var $image = $( '' ); - switch ( this.localName.toLowerCase() ) { + var selector_type = this.localName; + if (selector_type == undefined) selector_type = this.nodeName; // IE only + switch ( selector_type.toLowerCase() ) { case 'input': $( this ).data( 'original-text', this.value ); this.value = text; @@ -62,7 +64,9 @@ KOHA.AJAX = { $( selector ) .removeAttr( 'disabled' ) .each( function () { - switch ( this.localName.toLowerCase() ) { + var selector_type = this.localName; + if (selector_type == undefined) selector_type = this.nodeName; // IE only + switch ( selector_type.toLowerCase() ) { case 'input': this.value = $( this ).data( 'original-text' ); break; -- 1.5.6.5