Javascript Error with DataTable jQuery plugin
        Posted  
        
            by stevoyoung
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by stevoyoung
        
        
        
        Published on 2010-04-16T00:33:10Z
        Indexed on 
            2010/04/16
            0:43 UTC
        
        
        Read the original article
        Hit count: 515
        
I am getting a JS error and what to know what it means and how to solve it. (JS noob here)
Error: "tId is not defined"
Line of JS with error: "if (s[i].sInstance = tId) { "
More Information
I am using the Data Table (http://datatables.net) jQuery plugin.
I have a two tables with a class of "dataTable" loaded on a page (inside of jQuery UI tabs). The tables render as expected but I get the error above in Firebug.
Attached is my Data Table config file...
$(document).ready(function() {
//Take from: http://datatables.net/forums/comments.php?DiscussionID=1507
// before creating a table, make sure it is not already created. 
// And if it is, then remove old version before new one is created        
var currTable = $(".dataTable");
if (currTable) {
  // contains the dataTables master records
  var s = $(document).dataTableSettings;
  if (s != 'undefined') {
    var len = s.length;
    for (var i=0; i < len; i++)
    {   
        // if already exists, remove from the array
        if (s[i].sInstance = tId) {
            s.splice(i,1);
        }
    }
  }
}
oTable = $('.dataTable').dataTable({
        "bJQueryUI": true,
        "sPaginationType": "full_numbers",
        "bFilter": false
}); 
});
What does the error mean and how do I resolve it?
© Stack Overflow or respective owner