Server Side Processing Error in IE7 and IE8

Server Side Processing Error in IE7 and IE8

skhanzadaskhanzada Posts: 4Questions: 0Answers: 0
edited January 2010 in General
Hi,

I am using server side processing in java and my application is working fine in firefox. However, i am getting "length is null or not an object" error message in IE7. The error is on line no 203 and char 41.

It looks like some bug in server side processing when XHTML is used...?

I am writing json to the browser stream as it is written in the example php script.

Shoaib

Replies

  • skhanzadaskhanzada Posts: 4Questions: 0Answers: 0
    Following is my datatable code:

    $('#cdrsTable').dataTable({"sPaginationType": "full_numbers", "iDisplayLength": 25, "bProcessing": true, "bServerSide": true,
    "sAjaxSource": "${context}/services.get?type=cdrs&dateFrom=${param.dateFrom}&dateTo=${param.dateTo}"
    });
  • allanallan Posts: 63,407Questions: 1Answers: 10,452 Site admin
    Hi skhanzada,

    I'd be willing to lay a fairly large bet that your json looks something like this:

    [code]
    [ 1, 2, 3, 4, ]
    [/code]
    Note that trailing comma. It should be:

    [code]
    [ 1, 2, 3, 4 ]
    [/code]
    It's a fairly common issue when outputting json from a loop. IE rejects it (and rightly so imho) while Firefox actually allows it. http://www.jsonlint.com is an excellent site for validating json string.

    Regards,
    Allan
  • skhanzadaskhanzada Posts: 4Questions: 0Answers: 0
    Thanks allan now i can view the result on IE as well. However, IE7 is caching the json in its cache and not taking the updated records from server :-(

    I think i will need to disable the http cache for the sAjaxSource url...?

    Shoaib
  • allanallan Posts: 63,407Questions: 1Answers: 10,452 Site admin
    Hi Shoaib,

    IE is known it have rather aggressive caching of Ajax response messages for GET requests. To "fix" it, try using a POST request: http://datatables.net/examples/server_side/post.html

    Regards,
    Allan
This discussion has been closed.