IE 8 and Safari Issue with returned column count (giving alert datatables/tn/4)

IE 8 and Safari Issue with returned column count (giving alert datatables/tn/4)

lallerslallers Posts: 3Questions: 1Answers: 0

Hey everyone,

So I've undertaken a seemingly monumental task of providing a more user-friendly front-end for our Sharepoint 2010 site. It's quite stable at the moment with bootstrap/jquery so i've been implementing some stuff with Datatables. My issue is, everythin is working fine on Chrome and Firefox, but when using IE or Safari, i'm getting the error that it's trying to get the index of column 14. Well, there is no column 14. my array goes from 0-13. In Internet Explorer it's actually creating a 14th column. I tried searching the Google for a related issue but with no luck.

Unfortunately it's on an intranet so I cannot post it here to be tested.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,147Questions: 26Answers: 4,736

    Can you build a test case?

    If you don't have a problem opening the examples with IE or Safari then we would need to see what you are doing to help.

    Kevin

  • allanallan Posts: 61,451Questions: 1Answers: 10,055 Site admin

    It would be worth running the page's HTML through the W3C validator. It could be that a missing closing tag is being handled differently by the different browsers.

    Allan

  • allanallan Posts: 61,451Questions: 1Answers: 10,055 Site admin
    Answer ✓

    Oh - also, make sure you don't have any trailing commas if you are defining arrays such as columns.

    Allan

  • lallerslallers Posts: 3Questions: 1Answers: 0

    Hey guys,

    @kthorngren If Allan's suggestion does not pan out, i'll try and put something reproducible together. The issue is that it could also be the way the Sharepoint Content Editor Web part is handling the table in general (which wouldn't be testable off this specific site). I'm not too sure yet but wanted to make sure I didn't miss any know bugs!

    @allan,
    I will run it through the validator now. As for the trailing commas IE actually reported that as an error in the console so I took care of those already for sure. I'll report back after running it through the validator.

  • lallerslallers Posts: 3Questions: 1Answers: 0

    Oh dear, it turned out I still had a trailing comma when defining the columns. I had no idea it would interpret that as another column. Thanks!

  • allanallan Posts: 61,451Questions: 1Answers: 10,055 Site admin

    Yeah - old IE will put an undefined value at the end of the array if you leave a trailing comma. That's been resolved with the latest standards, but not if you are dealing with legacy browsers :).

    Allan

This discussion has been closed.