Securimage problem

Permalink
Hello,

I'm trying to build my own contact form with Securimage. In my view.php, I have this:
<div>
   <img id="captcha_img" src="<?php echo $this->action('securimage'); ?>" alt="CAPTCHA Image" /> 
   <script>
   $(function() {
      $('#captcha_img').click(function(){ 
         $(this).attr('src', '<?php echo $this->action('securimage'); ?>&time=' + (new Date).getTime());
      });
   });
   </script>
</div>


but when I click on it on the image it disappears instead of being reloaded.

My controller.php has this code for the securimage:

public function securimage() {
      Loader::library('3rdparty/securimage/securimage');
      $this->securimage = new Securimage();
      $this->securimage->show();
   }


What am I doing wrong? Will really appreciate your help. Thank you.

linuxoid