JavaScript error: 'iCreate' is null or not an object.
JavaScript error: 'iCreate' is null or not an object.
benwilson
Posts: 12Questions: 0Answers: 0
Hi,
We are getting this JavaScript error:
'iCreate' is null or not an object.
jquery.dataTables.1.9.3.js
Code: 0
Line: 4500
Char: 7
It only happens in IE 8.0.7600. (Not in IE 8.0.7601).
It only happens on servers that have https enabled.
The page that it happens on has multiple datatables on it.
This prevents the page from being displayed correctly.
Please help.
We are getting this JavaScript error:
'iCreate' is null or not an object.
jquery.dataTables.1.9.3.js
Code: 0
Line: 4500
Char: 7
It only happens in IE 8.0.7600. (Not in IE 8.0.7601).
It only happens on servers that have https enabled.
The page that it happens on has multiple datatables on it.
This prevents the page from being displayed correctly.
Please help.
This discussion has been closed.
Replies
[code]var attestationNonEmployeesTable;
$(function() {
attestationNonEmployeesTable = $('#attestationNonEmployeesTable').dataTable({
'bJQueryUI': true,
'bAutoWidth': false,
'bProcessing': true,
'bDeferRender': true,
'bSortClasses': false,
'bStateSave': true,
'sAjaxSource':'/myapp/home/getAttestationNonEmployeesData',
'sPaginationType': 'full_numbers',
'aaSorting':[[8,'asc']],
'aoColumns': [
{'bSearchable':false,'bVisible':false},
{'sClass':'column-1','bSortable':false},
null,
null,
null,
null,
null,
{'sType':'date'},
{'sType':'date'},
{'bSearchable':false,'bVisible':false}
],
'fnDrawCallback': function() {
if (Math.ceil((this.fnSettings().fnRecordsDisplay()) / this.fnSettings()._iDisplayLength) > 1) {
$('#attestationNonEmployeesTable_paginate.dataTables_paginate').css('display', 'block');
} else {
$('#attestationNonEmployeesTable_paginate.dataTables_paginate').css('display', 'none');
}
if(this.fnSettings().fnRecordsDisplay() > 10) {
$('#attestationNonEmployeesTable_length.dataTables_length').css('display', 'block');
} else {
$('#attestationNonEmployeesTable_length.dataTables_length').css('display', 'none');
}
},'fnInitComplete': function() {
var numRows = attestationNonEmployeesTable.fnSettings().fnRecordsTotal();
$('#attestationNonEmployeesCount').html(numRows);
if(0 == numRows) {
$('#attestationNonEmployeesContainer').css('display', 'none');
$('#attestationNonEmployeesEmpty').css('display', 'block');
}
attestationInit();
}
});
});
[/code]
That's an interesting one. I wonder if IE is doing something funny with https cookies. Could you possibly open the developer tools for IE or use Firebug Lite and type 'document.cookie' into the console and then paste the result in here so we can see what the cookie looks like?
Thanks,
Allan
This is the cookie text you asked for:
[code]"SpryMedia_DataTables_attestationNonEmployeesTable_; tabs-id=tabs-1; SpryMedia_DataTables_activeNonEmployeesTable_=%7B%22iCreate%22%3A1347550718166%2C%22iStart%22%3A0%2C%22iEnd%22%3A0%2C%22iLength%22%3A10%2C%22aaSorting%22%3A%5B%5B7%2C%22asc%22%2C0%5D%5D%2C%22oSearch%22%3A%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%22aoSearchCols%22%3A%5B%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%5D%2C%22abVisCols%22%3A%5Bfalse%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%5D%7D; SpryMedia_DataTables_inactiveNonEmployeesTable_=%7B%22iCreate%22%3A1347550718229%2C%22iStart%22%3A0%2C%22iEnd%22%3A0%2C%22iLength%22%3A10%2C%22aaSorting%22%3A%5B%5B7%2C%22asc%22%2C0%5D%5D%2C%22oSearch%22%3A%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%22aoSearchCols%22%3A%5B%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%5D%2C%22abVisCols%22%3A%5Bfalse%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%5D%7D; SpryMedia_DataTables_tasksTable_=%7B%22iCreate%22%3A1347550718260%2C%22iStart%22%3A0%2C%22iEnd%22%3A0%2C%22iLength%22%3A10%2C%22aaSorting%22%3A%5B%5B0%2C%22asc%22%2C0%5D%5D%2C%22oSearch%22%3A%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%22aoSearchCols%22%3A%5B%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%5D%2C%22abVisCols%22%3A%5Btrue%5D%7D; SpryMedia_DataTables_sponsoringManagersTable_=%7B%22iCreate%22%3A1347550718291%2C%22iStart%22%3A0%2C%22iEnd%22%3A0%2C%22iLength%22%3A10%2C%22aaSorting%22%3A%5B%5B0%2C%22asc%22%2C0%5D%5D%2C%22oSearch%22%3A%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%22aoSearchCols%22%3A%5B%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%2C%7B%22bCaseInsensitive%22%3Atrue%2C%22sSearch%22%3A%22%22%2C%22bRegex%22%3Afalse%2C%22bSmart%22%3Atrue%7D%5D%2C%22abVisCols%22%3A%5Btrue%2Ctrue%5D%7D; IPCZQX03a36c6c0a=a100ea01a1d7e5f0f0c6a801abdfadc8a782c696; ZNPCQ003-32383800=3ed665de; JSESSIONID=GfjpQR8H3Zv4FyJYQnW8HplQmsxsQp9NpvFbrvDQcTgGFhxtyXv5!-1383801396"[/code]
Thanks
-Ben
Thanks very much for that. I think I've discovered the issue based upon the contents of your cookie - the deletion of old cookies wasn't quite working as it should. I've just committed an update to the code for this issue, and you can get it from the 1.9.4.dev version on the DataTables download page: http://datatables.net/download .
I've just tried it out with a few cookie test pages I've got here in IE8 and various other browsers, but if you could let me know how you got on with the fix that would be great. I'll be packaging up 1.9.4 final soon(ish) :-)
Regards,
Allan
Thanks for the fix. I have yet to test it on our server (since that takes more time), but testing locally, it seems that the sorting is not always saved now. As I mentioned, I have multiple datatables, and sorting never saved for all of them. When I watch the cookies in firebug, changing the sort order of a table will make a new cookie appear for that table but make the cookie for another table disappear. I did not have this issue before.
Thanks!
-Ben
This blog post details how localStorage can be used to overcome some of these limitations: http://datatables.net/blog/localStorage_for_state_saving . Other options include using Flash or Ajax calls to the server.
(*) Actually the amount of information in the cookie can be reduced, to fit more in, but fundamentally, cookies are very limiting and are best avoided if possible.
Allan
Ben
Great - thanks for the feedback. Good to hear that localStorage is working well for you. I think at some point I'll put that into DataTables core and the cookies will be a developer defined option, like how localStorage currently is. Possibly in 1.10 in fact.
Regards,
Allan
Regards,
Allan