localization
localization
maxdiable
Posts: 6Questions: 3Answers: 0
hi,
i use:
$('#table-log').DataTable({
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.18/i18n/Italian.json"
},
});
but the localization not working.
any help?
br max
This discussion has been closed.
Answers
Your config seems to work here:
http://live.datatables.net/qubowuda/1/edit
Maybe something in your environment is causing the issue. Have you verified the Italian.json is being downloaded?
Kevin
hi,
i put the same code:
EDIT: Formatted JS code using Markdown
but no working
hi,
the firefox debug show this error:
SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
any help?
br
max
I copied your Datatables code here and it is still working:
http://live.datatables.net/mavapomu/1/edit
Does your table work if you remove the
language
option?You can try the torubleshooting steps at this link to see what is being returned:
https://datatables.net/manual/tech-notes/1
Kevin
It suggests that
window.localStorage.getItem("datatable")
is returning nothing - perhaps on the first load, or perhaps somehow invalid JSON got into it. Try:Allan
i changed my code:
$('#table-log').DataTable({
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.18/i18n/Italian.json"
},
});
datatable show data, but the language not loading, firefox show the same error:
SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
br
Max
i working width laravel:
and the chromwe show this error:
Failed to load http://cdn.datatables.net/plug-ins/1.10.18/i18n/Italian.json: Request header field X-CSRF-TOKEN is not allowed by Access-Control-Allow-Headers in preflight response.
br
Max
That's correct - you shouldn't be sending your CSRF token to a third party server. Doing so is a security issue since it would make it trivial to steal and then leave your service open to a CSRF attack (i.e. completely mitigating any benefit of using a CSRF token in the first place!).
Allan