Firefox trouble

Firefox trouble

susangsusang Posts: 5Questions: 0Answers: 0
edited August 2011 in General
I have the following code, which works in IE9 and Chrome. In Firefox however, neither of the columns that are supposed to sort by date do so (nothing happens when I click on them), and the fnDrawCallback doesn't fire. Do I have a syntax error somewhere that IE and Chrome are more forgiving of? Can someone please help me figure out why this doesn't work in Firefox?


$(document).ready(function() {
oTable = $('#xget').dataTable({
"aoColumns": [
null,
null,
null,
null,
{ "sType": "date" },
{ "sType": "numeric-comma" },
{ "sType": "numeric-comma" },
{ "sType": "date" }
],
"fnDrawCallback": function() {
document.exportToExcelForm.excelOutput.value = document.all['xget'].outerHTML.replace("\r\n","");
document.exportToPDFForm.PDFOutput.value = document.all['xget'].outerHTML.replace("\r\n","");
},
"oLanguage": { "sSearch": "Type anything to filter this data:" },
"iDisplayLength": 25,
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
});

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Syntax looks fine on a quick scan - does Firebug report any errors? One thing we have noted in the forums before is that Firefox is not very forgiving with invalid table markup - it would be worth running your page through the W3C HTML validator to check that it is okay.

    Allan
  • susangsusang Posts: 5Questions: 0Answers: 0
    After fighting with Firebug for a while I figured out that it was the outerHTML that Firefox objected to in the fnDrawCallback. Apparently Firefox doesn't recognize the outerHTML property. I added a custom function to emulate it, and that part works now. Still not able to get the date columns to sort though. Every other column sorts fine, which is weird.

    I'll doublecheck the tables and make sure they're valid. They're being generated on the fly by ColdFusion so it can sometimes get a bit confusing. Thanks for the tip.
This discussion has been closed.