PruitIgoe
PruitIgoe

Reputation: 6384

jquery 1.6.2 and IE8 error

In the uncompressed version of jquery 1.6.2 IE8 developer tools is telling me that line 6096 is throwing an error: Object required.

6096 reads: elem = div.childnodes;

It is part of an extend -

jquery.extend({ 
    clone: function( elem, dataAndEvents, deepDataAndEvents) { 

I am basically inserting or editing records in a MySQL db and displaying the records in tabular format. Where my script is breaking is where I am trying to display the HTML code - I initially was using $(div).html(code) but then reading a similar problem on here switched to$(div).empty() $(div).append(code) but either way I got the same error. Relevant portion of my code is below.

 ...

 //building table body
        tableCode += "<tr row=\"row_" + i + "\">";

        tableCode += "<td class=\"fileTitle tableCell\" key=\"title\" " + backgroundColor + "><p class=\"fileTitleTD\">" + fileLink + "</p><p class=\"fileTitleDesc\">" +  dataObj[thisRowData]['fileDescription'] + "</td>";
        tableCode += "<td class=\"fileType tableCell\" key=\"fileType\" " + backgroundColor + ">" + thisFileImage + "&nbsp;" + dataObj[thisRowData]['fileTypeExt'] + "</td>";
        tableCode += "<td class=\"lastUpdate tableCell\" key=\"lastUpdate\" " + backgroundColor + ">" + dataObj[thisRowData]['fileModed'] + "</td>";

        if(thisView == "admin") { 
            tableCode += "<td class=\"edit tableCell\"" + backgroundColor + " key=\"edit\"><p class=\"adminBtns\"><a href=\"javascript:void(0);\" class=\"editRecord\" recordID=\"" + dataObj[thisRowData]['fileId'] + "\">Edit</a></p></td>";
            tableCode += "<td class=\"delete tableCell\"" + backgroundColor + " key=\"delete\"><p class=\"adminBtns\"><a href=\"javascript:void(0);\" class=\"deleteRecord\" recordID=\"" + dataObj[thisRowData]['fileId'] + "\">Delete</a></p></td>";
        }

        tableCode += "</tr>";

    }

    tableCode += "</tbody></table>";

//-->BREAKS HERE
    $("#dataResultsTableBody").empty();
    $("#dataResultsTableBody").append(tableCode);

    //check if dataContainer is being displayed, if not display it
    $("#adminLogInFormContainer").hide();
    $("#siteCategorySelect").show();
    $("#siteCategoryItemTable").show();

...

Works fine in current version of Firefox and Safari and the new records or edited versions show when I reload the page. This was also a problem with jquery 1.4.2, I just updated today to see if the latest build fixed the issue. Any ideas if this is a problem on my end or IE's or jquery's? Thanks.

Upvotes: 1

Views: 1568

Answers (1)

Pekka
Pekka

Reputation: 449495

You need to have <tbody> elements in dynamically generated tables. You seem to be missing an opening tag for that.

Upvotes: 4

Related Questions