var GlobuleCaptcha = { getAnother: function() { new Ajax.Request("/Contact.php?captcha=new", { method: "get", onSuccess: this.showAnother.bind(this) }); }, showAnother: function(transport) { $('GlobuleCaptcha-img').src = '/Contact.php?captcha=' + transport.responseText; $('code').value = transport.responseText; } }