1 (edited by Pixel 2012-02-13 9:17:49 PM)

Topic: Debug output contains lots of errors when using JSON responses

I've noticed that Xajax 0.6 Beta 1 uses JSON responses by default. When I have debug mode enabled, I see loads of errors like this:

ERROR: ExecuteCommand (#1, ):
Invalid response command: Malformed response command received.

to

ERROR: ExecuteCommand (#38, ):
Invalid response command: Malformed response command received.

and these only show up in the debug output when using JSON responses. If I set

$xajax->configure('responseType','XML');

then there are no errors at all.

By the way, my Xajax functions work perfectly in either case.

Ideas ?

Re: Debug output contains lots of errors when using JSON responses

okay nice;

i will have a look inside (in my cases produces 50 #* debug-errors)
think it cames from an response stack or an array wich is empty.
and tries to register something

Re: Debug output contains lots of errors when using JSON responses

i have found an workaround

xajax_core_UNOMPRESSED.js from line 1300 (ca)

xajax.tools.json = {}

xajax.tools.json.processFragment = function(nodes, seq, oRet, oRequest) {
    var xx = xajax;
    var xt = xx.tools;
    for (nodeName in nodes) {
        if ('xjxobj' == nodeName) {
            for (a in nodes[nodeName])
            {
            
             /*
             prevents from using not numbered indexes of 'xjxobj'
             nodes[nodeName][a]= "0" is an valid xajax response stack item
             nodes[nodeName][a]= "pop" is an method from somewhere
             
             alternate you can change from continue to an break command;
             */
             if( parseInt(a) !=a)  continue;
            
                var obj = nodes[nodeName][a];
   
                obj.fullName = '*unknown*';
                obj.sequence = seq;
                obj.request = oRequest;
                obj.context = oRequest.context;
                xt.queue.push(xx.response, obj);
                ++seq;
   
            }
        } else if ('xjxrv' == nodeName) {
            oRet = nodes[nodeName];
        } else if ('debugmsg' == nodeName) {
             txt = nodes[nodeName];
        } else
            throw { code: 10004, data: obj.fullName}
    }
    return oRet;
}


i will send you an screen-shot from firebug this describes the situation