Internet Explorer Local Files not working for 1.10.13+
Internet Explorer Local Files not working for 1.10.13+
I have a problem with using DataTables in IE when opening it up locally: https://codepen.io/MadBoyEvo/pen/zYYoxzp
This code works fine in Chrome/Firefox and IE when used locally (as in from file path).
Now when I change this line:
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js" type="text/javascript"></script>
to
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js" type="text/javascript"></script>
or higher it will stop working in IE (but only locally) and continue to work in all other browsers.
What changed? Why does it happen? I get no errors.
On the other hand, I have this example: https://codepen.io/MadBoyEvo/pen/XWWNJeV which works fine locally even with
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
Do you see anything specific that I'm missing?
This question has an accepted answers - jump to answer
Answers
Not sure what you mean by locally. Please explain.
What exactly happens with IE? Do you get errors in your IE browser's console?
Its hard to say what the problem would be without seeing it. Sounds like you aren't able to replicate the problem with a test case.
Kevin
Locally as in C:\Users\przemyslaw.klys\OneDrive - Evotec\Support\GitHub\PSWriteHTML\Examples\Example-IE\TestIE.html
I save the file, run it from local path and it works until it's 1.10.12. After 1.10.13 it stops working. No errors in IE. Console is empty.
What is weird that when you check source in console it shows only some JS links: https://i.imgur.com/SLmUnsY.png - it should show like 20 links and it just sahows 3.
It seems like IE has problem displaying more lines in <head></head> When i remove some code from <head> it starts showing up more code. Really weird.
Hi @MadBoyEvo ,
As Kevin said, it's hard to diagnose without seeing it. Would you be able to zip a simple set of files and give instructions on how to reproduce, please? You can mail me at colin@datatables.net.
Cheers,
Colin
But I gave you a code? Just go to https://codepen.io/MadBoyEvo/pen/zYYoxzp
Copy code from HTML part (everything is in one slot) to a local file, name it: AnyHtmlFile.html and open it up with a browser (locally, without webserver). It will work. Now go to the HTML file and change the version from 1.10.12 to 1.10.13 or 1.10.20 and it will stop working right away. No responsive table, no pages visible, etc.
I mean I can always send it but it's all there, just copy paste and change one line and that's it.
Just to make sure you get what you requested I've sent an email with instructions and 2 files (working and not working). Hope it helps.
Hi - Colin sent the files on to me. Thanks for sending them in.
It looks like the problem is that IE does not support
localStorage
on file:// loaded pages. The result of that is that DataTables' state loading never completes because its still waiting on information coming back.I've committed a fix for that and it will be in the nightly shortly.
However, state saving will not work in IE when loaded form
file://
. There isn't anything I can do about that I'm afraid. I guess that they thought perhaps it was a security issue.Allan
Yeah, I found similar problems for my tabs implementation where I had to try/catch errors on local storage for IE to work. So I guess local storage was not part of 1.10.12 and added in 1.10.13?
Actually its not the localStorage that was the issue (that was in 1.10.0) - but rather the new ability in 1.10.13 to allow async loading of state. What happens now is that the state loading function either expects a value to be returned, or that a callback function will be called when it is ready.
In IE that callback we never happening because localStorage isn't available under
file://
hosting (it was undefined). The workaround I put in above will catch that condition, but as I say, it won't allow the state to actually be saved.Allan