Couln't get 'response' by ser in Data processor defineAction

Hello,

I couldn’t get ‘response’ by the server in Data processor defineAction. I checked in firebug and It shows the response correctly. Here is the response returned by the server:

<?xml version="1.0" encoding="utf-8"?>

Here is the code for Dataprocessor defineAction:
myDP.defineAction(“update”,function(sid,response){
var sid = response.getAttribute(“sid”);
alert (sid);
})
The response is somehow empty/null.

Please support me on this issue.
Thank you,
Hungnd

The correct code must look as

myDP.defineAction("update",function(response){ var sid = response.getAttribute("sid"); alert (sid); })

response is the first parameter of the callback, not the second as in original code snippet

Also, if response still empty it may be caused by invalid response ( invalid content type, some output before <?xml tag )

P.S. If original snippet was taken from documentation - please point to the misguiding page

Thank you so much, it’s working as expected now.
The response is the first param of the callback.

Cheers,
Hungnd