1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-30 23:52:11 +01:00

Fixed: Add a sanity check to ensure that the node given to DataTables is in fact a table - 2343

This commit is contained in:
Allan Jardine 2010-09-30 08:58:12 +01:00
parent 351218c473
commit 2315bf3635
2 changed files with 8 additions and 1 deletions

View File

@ -28,7 +28,6 @@
<h1>Live example</h1> <h1>Live example</h1>
<div id="demo"> <div id="demo">
<div id="me"></div>
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"> <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
<thead> <thead>
<tr> <tr>

View File

@ -6293,6 +6293,14 @@
oSettings.sInstance = _oExt._oExternConfig.iNextUnique ++; oSettings.sInstance = _oExt._oExternConfig.iNextUnique ++;
} }
/* Sanity check */
if ( this.nodeName.toLowerCase() != 'table' )
{
_fnLog( oSettings, 0, "Attempted to initialise DataTables on a node which is not a "+
"table: "+this.nodeName );
return;
}
/* Store 'this' in the settings object for later retrieval */ /* Store 'this' in the settings object for later retrieval */
oSettings.oInstance = _that; oSettings.oInstance = _that;