Table loading hangs at 'Processing' in IE7
Table loading hangs at 'Processing' in IE7
Asin
Posts: 5Questions: 0Answers: 0
Hello,
I have a strange problem: my code works fine in FF and Chrome, but not in IE. (Well, not so strange after all...) In IE7 the table loading always hangs before displaying real data. I can only see the header and the footer, column names, and the 'Processing' message. Of course, no browser error message. I've tried debugging with the very little possibilities I have on IE7, but no luck.
So far I've checked:
- Every JSON response in validator
- JS in validator
- Used FireBug in FF, reported no error
I'm pretty stuck here, could you please help?
Cheers,
Adam
PS: http://debug.datatables.net/opuniy
I have a strange problem: my code works fine in FF and Chrome, but not in IE. (Well, not so strange after all...) In IE7 the table loading always hangs before displaying real data. I can only see the header and the footer, column names, and the 'Processing' message. Of course, no browser error message. I've tried debugging with the very little possibilities I have on IE7, but no luck.
So far I've checked:
- Every JSON response in validator
- JS in validator
- Used FireBug in FF, reported no error
I'm pretty stuck here, could you please help?
Cheers,
Adam
PS: http://debug.datatables.net/opuniy
This discussion has been closed.
Replies
Thanks for the debug trace! It does look like it should be working okay... There are two things that stand out for me however:
1. The use of JSON.stringify - have you included json2.js or similar?
2. The debug trace shows that there is a line break in one of the lines which would invalidate the json. However, if that were the problem DataTables should specifically say that - so its probably not that!
The 'Processing...' message left hanging normally means that there is a JavaScript error somewhere (normally a trailing comma if it is IE7 only - although I can't see any in your debug trace!). As such, what I would suggest is opening the f12 developer tools in IE9 and running the page in IE7 mode. If there is indeed a script error, it will show up in the 'console' tab. Could you let us know what the error is, as that will help figure out what this issue is.
Regards,
Allan
Thanks for the fast response!
1. Is it mandatory to use json2.js? I don't really parse JSON, my server-side script is written in Perl.
2. Yep, I was scared like hell, because i've copied the JSON response from the table on the debug page, and it indeed put 2 line breaks in it. Fortunately if i copy&validate the response from Firebug, it validates just fine.
After further investigation i think the source of the problem is the request size... I have 53 columns...
Cheers,
Adam
53 columns are certainly a fair few, but it shouldn't do anything other than add a bit more processing time.
If you haven't got json2.js then that's likely to be the issue (or possibly one of them if there are more than one!). IE7 doesn't have a native JSON object - support for it was added in IE8, so yes, to use the JSON object you need a shim such as json2.js to add that ability in older browsers.
Did you try the f12 developer tools console? The error shown should hopefully back up what I'm saying :-)
Regards,
Allan
(Sent you a PM)
I've added json2.js to my code as:
[code]
[/code]
I've also made sure IE7 doesn't have a chance to cache my ajax requests, but no luck so far. Returned JSON data seems right to me. (I know IE7 is very picky about commas and semicolons here and there, but validators say my code is OK.)
Sadly, IE7 still won't load any data. All other browsers are OK, consoles are empty, no errors.
BR,
Adam
I think i've narrowed down the possibilities of the error. I've managed to install a third-party debugging plugin on IE7 and it displays HTTP info:
[code]
URL: http:///helloworld.swc?very_long_variable_list
Content Type:
Headers size (bytes): 0
Data size (bytes): 0
Total size (bytes): 0
Transferred data size (bytes): 0
Cached data: No
Error result: 0x800c0005
Error constant: INET_E_RESOURCE_NOT_FOUND
Error description: The server or proxy was not found
Extended error result: 0x7a
Extended error description: The data area passed to a system call is too small.
[/code]
I've googled the error code and the message, it came out the parameter list is too long for IE7. =/ At the moment i don't see any easy fix for this... (I should POST instead of GET, but then i have to modify lot of stuff...) Could you suggest a "quick and dirty" solution? Is there a way to get rid of the mDataProp params from the URL? I don't really use them, and they are taking up space. :)
Thanks in advance,
Adam
Quick and "dirty" solution was to use proper POST. :) I've added "sServerMethod": "POST" to the initialization, and put my extra params in with fnServerParams.
Now it works nicely. :)
Cheers,
Adam
Perfect - sServerMethod with a modification to the server-side script I think is absolutely the right way to do this and it's possible I'll make that the default in future DataTables (v2 when that happens). In theory it should be up to the http server to decide how long a request, but it looks like IE7 is trying to protect the server a bit, and just getting in the way doing so!
For completeness, it is possible to delete parameters from the object sent to the server using fnServerParams, but I think using POST is a better suction here, just in case you every want to use the mDataProp values on the server-side!
Regards,
Allan