Hi,

I'm having a problem with returning a JSON object from an actionlink
in (5.0.11-SNAPSHOT). I have some javascript that submits a request,
which works great, and the actionhandler returns a JSONObject as
follows


Object onUpdate() {
        ....
        JSONObject json = new JSONObject();
        json.put("fcId", fcId);
        return json;
}

This works fine, but on the client side I get:

onComplete : function(transport) {
         var response = transport.responseText;
//      if (response.length>2 && response.endsWith("{}"))
//              response = response.substring(0,response.length-2);
        var reply = response.evalJSON(true);
        ....
}

The responseText contains

{"fcId":36178}{}

If I strip of the additional two braces everything is great and the
reply is parsed correctly, but I must be doing something wrong.
prototype.js says that JSON objects are often accessible directly from
transport.headerJSON, but this is null in my case. Anybody got any
ideas what I need to do to not have the additional 2 braces?

Thanks,

Adriaan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to