Getting TN/4 error ONLY in Internet Explorer!

Getting TN/4 error ONLY in Internet Explorer!

DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0

I am having one of the weirdest issues.

So i have node.js application that uses express to deliver json objects. I use Jquery and use an ajax call to pull data from this node.js application and store the JSON object as a global variable. I then use datatables loading this JSON object as its data.

Problem is if I access my HTML via file:// everything works in both Chrome and IE. However when I put my HTML onto the IIS server, It only works in Chrome. In IE i get the TN/4 error saying the first cell of the first column is invalid. I find this incredibly bizarre and could only mean something is wrong in my IIS settings thats messing it up for IE.

I already added MIME type support in IIS7 for JSON additionally everything is in UTF-8.

What else could it be? Anyone know any direct conflicts with IIS and Datatables.net?

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    There shouldn't really be any conflicts between DataTables and any web-server since the web-server just handles the request. Possibly there is something going wrong in the script being processed though.

    Are you able to link us to the page so we can take a look please.

    Allan

  • DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0
    edited June 2014

    Hi Allan,

    I cant link to the table directly because it is on a corporate intranet testing server but I scrubbed our data and I can provide the debug link.

    A little more information about the setup

    MSSQL --> NodeJS Express --> JSON Object

    The HTML does a $.when calling 2 ajax requests to my NodeJS Express API for the data. I broke it into two because IE was having massive issues handling a 26MB JSON File, but breaking it into 2 it seems to like it better. It then drops those into two empty global arrays so datatables can access those variables.

    I repeat, there are absolutely 0 problems with Chrome/Firefox/Safari. The problem all lies in IE9+ and I suspect it has something to do with either timing/JSON butchering by IE/ or something completely out of my experience.

    the .then part to the jquery when function initalizes the table so that it knows for sure once it receives 2 successes from the AJAX, it will run the function to start datatables.

    Everywhere I can see in IE, it has loaded the JSON objects properly with proper headers, etc.

    Whats even weirder is that this only happens when IIS7 is delivering the webpage. If I were to access the .html from my local storage as a file:// it works fine in IE9+ even though it is still doing AJAX from my NodeJS Express server.

    I am considering serverside processing but I have no experience with coding back end like that because I have no .net experience nor php experience (Why I chose NodeJS as my language).

    (The debug link is taking forever to upload)

    <script>
    $(document).ready(function() {
        $("#table1_div").hide();
        $("#loadingGIF").show();
    });
    
    $.support.cors = true;
    
    function loadTable() {
            var table = $('#table_1').dataTable( {
                "data" : jsonTop,
                "columns": [
                    { "data": "policyid"},
                    { "data": "policytxnid"},
                    { "data": "pol submission no"},
                    { "data": "txn submission no"},
                    { "data": "sprtype"},
                    { "data": "accountname"},
                    { "data": "statecode"},
                    { "data": "policynumber"},
                    { "data": "geniusseqno"},
                    { "data": "previouspolicynum"},
                    { "data": "insurancecompanyname"},
                    { "data": "transactiontypecd"},
                    { "data": "new renewal?"},
                    { "data": "isproducercreated"},
                    { "data": "SIC Code"},
                    { "data": "SIC Description"},
                    { "data": "Curr Eff Date"},
                    { "data": "Curr Exp Date"},
                    { "data": "Term Factor"},
                    { "data": "Exp Eff Date"},
                    { "data": "Exp Exp Date"},
                    { "data": "Exp Term Factor"},
                    { "data": "policy annual premium"},
                    { "data": "policy term premium"},
                    { "data": "surcharges"},
                    { "data": "taxes"},
                    { "data": "assessments"},
                    { "data": "Curr Commission"},
                    { "data": "Exp Commission"},
                    { "data": "binddate"},
                    { "data": "systemuwid"},
                    { "data": "uwlastname"},
                    { "data": "Nature Ops"},
                    { "data": "Exp Nature Ops"},
                    { "data": "Curr non-CSL Cov Prem"},
                    { "data": "Exp non-CSL Cov Prem"},
                    { "data": "Curr Final Cov Prem"},
                    { "data": "Exp Final Cov Prem"},
                    { "data": "Curr Limit"},
                    { "data": "Curr Retention"},
                    { "data": "Exp Limit"},
                    { "data": "Exp Retention"},
                    { "data": "BusinessYears"},
                    { "data": "assetvalue"},
                    { "data": "revenuevalue"},
                    { "data": "isnetincome"},
                    { "data": "netlossincomeapplicableamount"},
                    { "data": "iscashflowpositive"},
                    { "data": "cashflowapplicableamount"},
                    { "data": "BaseRate"},
                    { "data": "ILF"},
                    { "data": "Base SIR"},
                    { "data": "SIR Factor"},
                    { "data": "AdjBaseRate"},
                    { "data": "ExpBaseRate"},
                    { "data": "Exp ILF"},
                    { "data": "Exp Base SIR"},
                    { "data": "Exp SIR Factor"},
                    { "data": "Exp AdjBaseRate"},
                    { "data": "Nature Ops Factor"},
                    { "data": "Yrs in Bus Factor"},
                    { "data": "# Subsids Factor"},
                    { "data": "M&A Last 18"},
                    { "data": "M&A Next 18"},
                    { "data": "Mgmt Ownership"},
                    { "data": "Sec Last 18"},
                    { "data": "Sec Next 18"},
                    { "data": "Pend Pub Sec"},
                    { "data": "Litigation Last 3"},
                    { "data": "Other Litigation"},
                    { "data": "Domicile in State"},
                    { "data": "Other-Must Comment"},
                    { "data": "Net Income"},
                    { "data": "Net Loss"},
                    { "data": "Positive Cashflow"},
                    { "data": "Negative Cashflow"},
                    { "data": "Assets > Liabilities"},
                    { "data": "Liab > 75% Assets"},
                    { "data": "Liab Mature 18 Mos"},
                    { "data": "Reorg or Bankruptcy"},
                    { "data": "CSL"},
                    { "data": "Other"},
                    { "data": "Side A Prem Charge"},
                    { "data": "Claims/Litigation History"},
                    { "data": "Stability of Workforce"},
                    { "data": "Other Financial Factors"},
                    { "data": "Takeover Potential"},
                    { "data": "Effected by Recession"},
                    { "data": "Riskiness of Industry"},
                    { "data": "Mgmt Experience / Stability"},
                    { "data": "SR Min"},
                    { "data": "SR Max"},
                    { "data": "iscslapplied"},
                    { "data": "selectedcsl"},
                    { "data": "csllimit"},
                    { "data": "cslpremium"},
                    { "data": "csldopremium"},
                    { "data": "csleplpremium"},
                    { "data": "cslfidpremium"},
                    { "data": "producercode"},
                    { "data": "producername"},
                    { "data": "createddate"},
                    { "data": "zipcode"},
                ],
                "dom": 'TC<"clear">lfrtipS',
                "tableTools": {
                    "sRowSelect": "multi",
                    "aButtons": [
                        {
                            "sExtends": "copy",
                            "bSelectedOnly": true,
                            "mColumns": "visible"
                        },
                        {
                            "sExtends": "csv",
                            "bSelectedOnly": true,
                            "mColumns": "all"
                        },
                        {
                            "sExtends": "xls",
                            "bSelectedOnly": true,
                            "mColumns": "all"
                        },
                        {
                        "sExtends":    "select_all",
                        "sButtonText": "Select Filtered",
                        "fnClick": function (nButton, oConfig, oFlash) {                                                  
                        var oTT = TableTools.fnGetInstance('table_1');
                        oTT.fnSelectAll(true); //True = Select only filtered rows (true). Optional - default false.
                            }
                        },
                        {
                            "sExtends": "select_none",
                            "mColumns": "visible"
                        }
                    ],
                    "sSwfPath": "swf/copy_csv_xls.swf"
                },
                "colVis": {
                    exclude: [ 0 ]
                },
                "scrollX": true,
                "scrollY": "440px",
                "scrollCollapse": true,
                "autowidth": true,
                "info": true,
                "iDisplayLength": 10,
                "ServerSide": false,
                "deferRender": true
            } )
        .columnFilter();
        var table = $('#table_1').DataTable();
        table.rows.add(jsonBot).draw();
    };
    
    var jsonTop = [];
    var jsonBot = [];
    
    $.when(
        $.ajax({
            url: 'http://localhost:999/empleplrestop',
            success: function(dataTop) {
                jsonTop = dataTop;
            }
        }), 
        $.ajax({
            url: 'http://localhost:999/empleplresbot',
            success: function(dataBot) {
                jsonBot = dataBot;
            }   
        })
    ).then(function() {
        $("#table1_div").show();
        $("#loadingGIF").hide();
        loadTable();
    });
    
    
    </script>
    

    I tried also just debugging the TN4 as if it was a TN4 error but I got no results. My table has the exact same name and # of columns in the HTML skeleton as outlined by data:, I made sure this was the case by copying a list of my columns and using find and replace to make the {data: and <tr> marks so it is the same.

    Here is a sample of my JSON

    http://jsonblob.com/53a045f6e4b01e6936591466

    Maybe theres something wrong here with the output?

    Im really at a loss of ideas of why IE9+ would just not parse this correctly when the HTML is delivered by IIS

    (Also the Debug link kept erroring out, it kept making a GET call and kept responding with Key not found and began looping.)

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    .columnFilter();

    What happens if you disable that? It is a 3rd party plug-in and hasn't been updated recently as far as I am away.

    Beyond that, I'm afraid I really don't know why there would be a difference if the JSON being returned is identical.

    Allan

  • DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0
    edited June 2014

    still same issue on IE. Chrome and others loads fine obviously now my column filtering is disabled but the data comes through fine. I reduced the size of the json file to only 10 rows and now all the rows in IE are returned as null.

    I have some null points in the data so I am trying to use the default content but the documentation is confusing since its using nulls in the data columns itself as an input.

    So i did this. Now I am getting a TN/4 error in Chrome but the datatable still loads fine even having "NA" in null cells, IE9+ still does not work (showing all NULLs in all rows despite checking in console for JSON object...)

                    { "data": "Exp Eff Date", "defaultContent": "NA" },
                    { "data": "Exp Exp Date", "defaultContent": "NA" },
                    { "data": "Exp Term Factor", "defaultContent": "NA" },
    

    I am confus.

    To Summarize:

    I disabled the 3rdparty filter as you said, same issue as original problem.

    I reduced JSON file to make the load time on the page shorter and in IE9+ HTML delivered by IIS = all null table despite proper JSON there. Works fine in Chrome

    I then added the defaultContent to the columns that had nulls and now I am getting a TN/4 error in ALL Browsers but every browser except IE9+ still ends up loading the data fine despite the error and even showing nulls as "NA".

  • DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0
    edited June 2014

    I am beginning to really think IE is doing something to the JSON object once it passes it through to Datatables.

    So theres only a total of 20 objects, 10 in one array another in the other. in Chrome where it loads, it reads 20 objects fine.

    but in IE, it thinks there 46,616 objects!

  • DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0
    edited June 2014

    http://i.imgur.com/i5Tb9XE.jpg

    IE is adding quotes around my array. Is this a problem? I think soooooo? What the hell why would it do that.

  • DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0
    edited June 2014

    I figured out the problem Allan.

    It was staring me right in the face but I didnt notice it because IE was receiving the AJAX just fine.

    When I rewrote my ajax calls i forgot to include

    dataType: 'json',
    
    

    So that jQuery knows to parse the response into success as a JSON object.

    Chrome evidently knows how to read the object and identify it properly before passing it, IE only does what it is told and only looks at things the way it was told to look at them.

    additionally any word on this?

    http://datatables.net/forums/discussion/comment/62060/#Comment_62060

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited June 2014 Answer ✓

    Good to hear you got it working.

    No fix for the defer render issue yet, I'm still working on other things.

    Allan

  • DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0
    edited June 2014

    Allan,

    In the other thread you said how priority support could be purchased to have this issue resolved sooner.

    I want to ask has this deferred rendering bug with export in tablestools already been made a priority? If not, what would I need to purchase to have this issue made onto a priority list?

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Currently no one with priority support has asked me to look into this issue yet, so other things are currently taking priority. The Quick Support 60 option would allow me to prioritise this fix.

    I am planning to release 1.10.1 later this week or at the start of next, and I'll have a fix for this in that. Priority support would allow me to fix it sooner and help to support DataTables as a whole, but a fix is coming even without it.

    Allan

  • DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0

    Thank you so much Allan. I will then instead buy some of the supporter options since I do not need the credits! You've been awesome! Keep up the good work.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    An update on thread 62060 - the fix has been committed now. Any further discussion on that topic should be in that thread only, rather than splitting it between multiple threads.

    Allan

  • peterpaulpeterpaul Posts: 1Questions: 0Answers: 0
    edited November 2014

    I was struggeling with the same error - Finally I figured out, that I IE throws an error, when the array of columns ends with a "," comma and no futher element.

    Removing the comma after { "data": "zipcode"}, should fix your problem.

This discussion has been closed.