Works in Mozilla / Firefox but not in MSIE
Works in Mozilla / Firefox but not in MSIE
Philip Harvey
Posts: 23Questions: 0Answers: 0
Hi, I have been using DataTables for a while and have had a number of small problems, most of my own creation that you have helped me resolve but have now come across a problem that baffles me.
I use a variable to provide the DataTables definition so that I can set up multiple pages with differing tables without each one being defined in the HTML header. The code below works perfectly in Mozilla / Firefox but when used in MSIE I can see the table being rendered but then it just disappears. Is this an issue of the two browsers have a differing intolerance to errors or is it a known problem
Many thanks in advance
[code]
$btype = ".dataTable" ;
$bdata = '"bPaginate": true,"bLengthChange": true,"bInfo": true,"bFilter": true,"sPaginationType": "two_button","aaSorting": [[ 4, "desc" ]],"aoColumns": [null,null,null,null,null,{ "bSortable": false },
{ "bSortable": false },{ "bSortable": false },{ "bSortable": false },{ "bSortable": false },{ "bSortable": false },{ "bSortable": false },null,null,{ "bSortable": false },{ "bSortable": false }]';
[/code]
I use a variable to provide the DataTables definition so that I can set up multiple pages with differing tables without each one being defined in the HTML header. The code below works perfectly in Mozilla / Firefox but when used in MSIE I can see the table being rendered but then it just disappears. Is this an issue of the two browsers have a differing intolerance to errors or is it a known problem
Many thanks in advance
[code]
$btype = ".dataTable" ;
$bdata = '"bPaginate": true,"bLengthChange": true,"bInfo": true,"bFilter": true,"sPaginationType": "two_button","aaSorting": [[ 4, "desc" ]],"aoColumns": [null,null,null,null,null,{ "bSortable": false },
{ "bSortable": false },{ "bSortable": false },{ "bSortable": false },{ "bSortable": false },{ "bSortable": false },{ "bSortable": false },null,null,{ "bSortable": false },{ "bSortable": false }]';
[/code]
This discussion has been closed.
Replies
I presume that this is PHP code? In which can't, I don't see anything wrong with it either. It's odd that the table would render, and then disappear. That would tend to suggest a CSS issue to me (because on a JS error the table will typically be in it's unenhanced state). Using the IE developer tools, can you see the table in the DOM? Do you have a link to an example you can post?
Thanks,
Allan
Try this link .... http://www.test.horizondevelopers.co.uk/H2030/H2030_Listing1.php. This should show the fully formatted table in Mozilla / Firefox but in MSIE the table will disappear when the table has finished building.
Many thanks for you help with this
Phil
It looks like the table is disappearing due to a JavaScript error. It's a little tricky to trace this error at the moment as you are using a minified version of jQuery, which is where IE says the error is occurring (unlikely that the error is actually in the jQuery code though!). Would it be possible to put the development version of jQuery in to trace the problem down?
Also, I notice that you are using DataTables 1.4.0. I'd recommend upgrading to 1.4.3 (latest in the 1.4 series) or even 1.5 beta 9 (latest in the 1.5 beta series - it's stable! - almost a Google beta...) and seeing it that helps. If not, shout!
Regards,
Allan
Thanks for your help with this. I have updated DataTables to the new beta and changed the JQuery to use the full version. I had the new beta on our test site and it works really well but still has the same problem with the code at the link above
I hope this helps :-)
Phil
Nice one - thanks for that. I have to say the new JS debugging tools in IE8 aren't to bad at all :-)
I suspect (but not 100% sure) that the problem that you are running into is because of an issue with the validity of your HTML. Specifically you have a at the end of the table - which might well be confusing the browser. I'd suggest passing your HTML through the W3C validator and just making sure it passes. That then eliminates one option for what might be happening!
Regards,
Allan
You were spot on, the at the end of the table before the closing tag was the problem. With that removed all works perfectly. I'm not sure if it is just me but new beta version also seems to run a bit faster which is always a good thing.
Many thanks again Allan, excellent program and great support