Microsoft JScript runtime error: 'length' is null or not an object

Microsoft JScript runtime error: 'length' is null or not an object

jhainesjhaines Posts: 6Questions: 0Answers: 0
edited July 2009 in General
I have a custom filter that I want to apply that works as long as there are rowns returned from the search. If there are no rows returned I get JScript error:

Microsoft JScript runtime error: 'length' is null or not an object

on this code...

$.fn.dataTableExt.aTypes = [
/*
* Function: -
* Purpose: Check to see if a string is numeric
* Returns: string:'numeric' or null
* Inputs: string:sText - string to check
*/
function ( sData )
{
var sValidChars = "0123456789.-";
var Char;

for ( i=0 ; i

Replies

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin
    Hi John,

    You could just add a 'sanity' check into your code - something like:

    [code]
    if ( typeof sData != 'string' )
    {
    return null;
    }
    [/code]
    How does that sound?

    Regards,
    Allan
This discussion has been closed.