Error 'length is null or not an object' in IE8

Error 'length is null or not an object' in IE8

nicola.peluchettinicola.peluchetti Posts: 10Questions: 0Answers: 0
edited December 2010 in General
Hi,

i have a problems on a particular table: in firefox everything is ok, but in IE8 i always get the error shown in the title. It points to line 719 of datatables 1.7.4 (i'm using jquery 1.4.4).

this is the code at line 719

[code] function ( sData )
{
/* Allow zero length strings as a number */
if ( sData.length === 0 )//Line 719
{
return 'numeric';
}
[/code]
i think thata the problem is that sData is null, because if i put
[code]
if (sData == null){
sData=''
}
[/code]

i don't get the error anymore, but i still get the same type of error in some other point. Has anyone experienced a behaviour like this?

Replies

  • nicola.peluchettinicola.peluchetti Posts: 10Questions: 0Answers: 0
    The problem appears to be in my aoColumns definition:

    [code]
    "aoColumns": [
    null,
    null,
    null,
    { "bVisible": false} ,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null
    ]

    [/code]
    if i remove it, there is no error
  • nicola.peluchettinicola.peluchetti Posts: 10Questions: 0Answers: 0
    The problem was in the space after { "bVisible": false}!
  • paolopaolo Posts: 1Questions: 0Answers: 0
    I had the same problem.
    Thanks for pointing out the cause Nicola.
    But Microsoft... how is that an error? If anything, the error is in the parser.
  • NettSiteNettSite Posts: 36Questions: 11Answers: 2
    I have just had a similar problem, and clearing all spaces, new lines, carriage returns and tabs from the code passing parameters solved it for me - thanks to nicola.peluchetti for pointing me in the correct direction.
This discussion has been closed.