Getting TN/4 error ONLY in Internet Explorer!
Getting TN/4 error ONLY in Internet Explorer!
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
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
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)
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.)
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
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...)
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".
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!
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.
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
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
Good to hear you got it working.
No fix for the defer render issue yet, I'm still working on other things.
Allan
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?
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
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.
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
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.