Quote:
Originally Posted by code0 Did anything change between 4.5.5 and 5.0.2 in how AjxRpc callbacks are done? I'm using the code below, but the callback never fires. I verified with Firebug that the server is returning data (just plain text). Ideas? Code: Com_Zimbra_Phone._doCallTo = function(phone) {
var stURL = 'http://asterisk.domain.com/user/c2c.php?dst=' + encodeURIComponent(phone) + '&ai=' + AjxCookie.getCookie(document,'authinfo');
var url = ZmZimletBase.PROXY + escape(stURL);
if (confirm('Are you sure you want to call ' + phone + '?')) {
AjxRpc.invoke(null, url, null, new AjxCallback(this, this._doCallToCallback), true);
}
}
Com_Zimbra_Phone._doCallToCallback = function(response) {
alert(response.text);
} |
AjxRpc.invoke hasn't changed. The problem is that you're creating a callback with an object context, but your function is static. You should either make your class concrete, using a prototype so that there's a "this", or change your callback to:
new AjxCallback(null, Com_Zimbra_Phone._doCallToCallback)