Error in Line 66 - 'length' is null or not is a object

Error in Line 66 - 'length' is null or not is a object

lusabolusabo Posts: 18Questions: 0Answers: 0
edited August 2011 in General
Hi all,

I have this script:

[code]
oTable = $('#example').dataTable({
"sAjaxSource": 'ControleManterOrigemACT.asp?psAcao=index',
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": {
"sSearch": "Filtrar registros:",
"sEmptyTable": "Nenhum registro disponível na tabela",
"sLengthMenu": "Mostre _MENU_ registros por página",
"sZeroRecords": "Nenhum registro encontrado",
"sInfo": "_START_ a _END_ de _TOTAL_ registros",
"sInfoEmpty": "0 a 0 de 0 registros",
"sInfoFiltered": "(filtrados do total de _MAX_ registros)",
"oPaginate": {
"sFirst": "Primeiro",
"sLast": "Último",
"sNext": "Próximo",
"sPrevious": "Anterior"
}
}
});
} );
[/code]

And my asp page returns an array like this:

[quote]
[["18","teste"],["19","aaaaaaa"],["81","Autuação Fiscal"],["101","Autuação Fiscal Eletrônica"],["102","DCOMP - Declaração de Compensação"],["103","Pedido de Restituição"]]
[/quote]

Look the code of my asp page ( i put it simplified):

[code]
<%
function toJSON(paVariant)
Dim j, json
json = "["
For j = 0 To UBound(paVariant, 2)-1
json = json + "[""" & paVariant(0,j) & """" & "," & """" & paVariant(1,j) & """]" & ","
Next
json = Left(json, Len(json) - 1) & "]"
toJSON = json
end function

sub index
if not goOrigemACT.obterListaOrigemACT(goBD, gaListaOrigemACT, gsErro, gsErroComplemento) then
gsMensagem = goMensagem.obterMensagem(gsErro, gsErroComplemento)
end if
Response.write toJSON(gaListaOrigemACT)
Response.end
end sub

select case gsAcao
case "index"
call index
end select
%>
<!--#include file="TelaManterOrigemACT.asp"-->
[/code]

Why the error [quote]Error in Line 66 - 'length' is null or not is a object[/quote] happens?

Thanks,
Luciano

Replies

  • lusabolusabo Posts: 18Questions: 0Answers: 0
    I solved this way:

    In sub index:

    Response.write "{""aaData"":" & toJSON(gaListaOrigemACT) & "}"
This discussion has been closed.