From cd0babca5424c7c34b902a770804648bf304adeb Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Mon, 2 Apr 2012 10:25:52 +0100 Subject: [PATCH] Fix: IE6/7 return an empty string for getAttribute('id') when there is no ID attribute, rather than null. As such tables were not automatically being given an ID when they didn't have one, which created a situation where the settings object for a table could be 'lost' in IE6/7. Now check for empty string when checking the table ID. --- media/js/jquery.dataTables.js | 2 +- media/src/core/core.constructor.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index dbf683f4..b9aa329f 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -6178,7 +6178,7 @@ } /* Ensure the table has an ID - required for accessibility */ - if ( sId === null ) + if ( sId === null || sId === "" ) { sId = "DataTables_Table_"+(DataTable.ext._oExternConfig.iNextUnique++); this.id = sId; diff --git a/media/src/core/core.constructor.js b/media/src/core/core.constructor.js index 2940dab8..10e47e97 100644 --- a/media/src/core/core.constructor.js +++ b/media/src/core/core.constructor.js @@ -50,7 +50,7 @@ for ( i=0, iLen=DataTable.settings.length ; i