Ajaxový request na formulář s captchou

public function refreshAction(){    $form = new Form_Contact();    $captcha = $form->getElement('captcha')->getCaptcha();    $data = array();    $data['id']  = $captcha->generate();    $data['src'] = $captcha->getImgUrl() .                   $captcha->getId() .                   $captcha->getSuffix();   $this->_helper->json($data);}

Nahrazení obrázku javascriptem

$(document).ready(function() {    $('#refreshcaptcha').click(function() {        $.ajax({             url: '/refresh-captcha',             dataType:'json',             success: function(data) {                 $('#refreshcaptcha').parents('form').find('img').attr('src', data.src);                 $('#captcha-id').attr('value', data.id);             }        });        return false;    }); });