Problems in IE8

Problems in IE8

dmcleandmclean Posts: 55Questions: 2Answers: 0
edited March 2012 in Bug reports
I'm trying to track down some problems that occur in IE8. The error occurs in the section of code below. On the console, I get the output shown at the bottom. Without the try/catch, the IE stack trace points to a section of embedded CSS (clearly not helpful).

I'm using DataTables 1.8.2 (non-minimized version) with JQuery 1.7.1 (again, non-minimized version) and I would rather not upgrade until I wrap up this iteration and start the next one.

Any suggestions on how to correct the problem (if you magically know the answer), or what I can do to find out the underlying source of the problem would be greatly appreciated.

Thank you,

Donald

[code]
try {
contextTable = $('#contextData').dataTable({
"sScrollY":"600px",
"bPaginate":false,
"bSortClasses":false,
"aoColumns":[
{ "bSortable":false },
null,
null,
null,
null,
null,
null,
null,
null,
null,
{ "bVisible": false }
],
"aaSorting":[
[1, 'asc']
],
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
nRow.setAttribute("class", aData[STATUS_INDEX]);
return nRow;
}
});

oTable = contextTable;
} catch (e) {
console.log("Exception calling dataTable: " + e.name + ", " + e.message)
}
[/code]

LOG: Exception calling dataTable: TypeError, Object doesn't support this property or method

Replies

  • allanallan Posts: 63,397Questions: 1Answers: 10,451 Site admin
    Interesting - I don't really see anything wrong with what is given above. Could you run your table through the debugger and post the debug code please: http://debug.datatables.net ?

    Thanks,
    Allan
  • dmcleandmclean Posts: 55Questions: 2Answers: 0
    olagep

    Donald
  • allanallan Posts: 63,397Questions: 1Answers: 10,451 Site admin
    How very odd! I can't see anything in the debug trace that would suggest that there was a problem, or what would be a the problem. Indeed, the table state says that the table has finished its initialisation.

    If you remove the try/catch code, leaving just the DataTables initialisation, does the error point to something a bit more specific?

    Thanks,
    Allan
  • dmcleandmclean Posts: 55Questions: 2Answers: 0
    My bad. Turns out it's the same problem as this:

    http://datatables.net/forums/discussion/5082/object-doesnt-support-property-or-method-datatable/p1

    It should be "var contextTable"

    I'm also getting a similar error in the function shown below, but I haven't figured that one out yet.

    [code]
    var baseString = "";
    var commandString = "";
    var options = new Array();
    var required = new Array();

    $.fn.dataTableExt.oApi.fnDoSomething = function (oSettings, opName) {
    console.log("[fnDoSomething] enter.");

    baseString = "";
    commandString = "";
    options = new Array();
    required = new Array();

    try {
    var statusList = createStatusList(oSettings);
    // for (var k = 0; k < statusList.length; k++) {
    // console.log("[fnDoSomething] statusList[" + k + "]: " + statusList[k].name + ", " + statusList[k].count);
    // }
    var dadsOp = findOp(opName);
    var messageContent = dadsOp.messageOne;
    if (statusList.checkCount > 1) {
    messageContent = dadsOp.messageMult;
    }
    createPopup(messageContent, statusList);

    var idList = "";
    for (var i = 0; i < statusList.length; i++) {
    var next = statusList[i];
    var j = 0;
    for (j = 0; j < next.idList.length; j++) {
    if (idList.length > 0) {
    idList = idList + ",";
    }
    idList = idList + next.idList[j];
    }
    }
    baseString = dadsOp.agent + ";" + idList;

    overlay();
    }
    catch(e) {
    console.log("[fnDoSomething] got exception: " + e);
    }
    };
    [/code]
  • allanallan Posts: 63,397Questions: 1Answers: 10,451 Site admin
    Glad you found that thread - I said there:

    > Ah! Interesting - I didn't know that, but very useful knowledge

    I wish that knowledge had stuck a bit longer than it did! It should be that your variable would just become 'global', but obviously IE8 does something odd...

    For the second issue - if you remove the try/catch, does IE not give you the line number for where the error is occurring?

    Allan
  • dmcleandmclean Posts: 55Questions: 2Answers: 0
    Actually, I get a line number even WITH the try/catch.

    I click on this button:



    Which calls the code above. I get this message:

    Object doesn't support this property or method aoiDev, line 42 character 20

    When I click on the "link" for aoiDev, line 42, character 20 it sends me to this part of the file:

    [code]
    .sidebar ul li {
    margin: 0;
    padding: 1px;
    list-style: none;
    border: 1px solid #ccc;
    border-bottom: none;
    }
    [/code]

    where line 42 is the padding line, and character 20 is the colon. Obviously, that's not the actual line or character, but IE just isn't being very helpful and I'm not sure what to try next.
  • allanallan Posts: 63,397Questions: 1Answers: 10,451 Site admin
    No that's completely useless from IE...

    What's the code that uses aoiDev?

    Allan
  • dmcleandmclean Posts: 55Questions: 2Answers: 0
    I think that aoiDev is referring to the URL (https://myhost.stsci.ed/aoiDev/)
  • allanallan Posts: 63,397Questions: 1Answers: 10,451 Site admin
    Oh I see. And when you right click and select view source, line 42 is CSS is it (baring in mind that your page might be possessed on the server-side so it might be different on the client-side if you have includes, function sets)?

    Allan
  • dmcleandmclean Posts: 55Questions: 2Answers: 0
    So it turns out that the problem was more of the same kind of thing. I needed to move "contextTable" into the global name space rather than declaring it in onLoad.
This discussion has been closed.