protected function getScript() { ob_start(); ?> <?php echo parent::getScript(); ?> $(document).ready(function() { // jQuery Form: Manipulação de formulário via AJAX $('#myLogin').ajaxForm({ success: function(data) { // Redirecionamento de página if(data.redirect != null) window.location.href = data.redirect; // Preenche mensagem global $('#message').hide().html(data.message).fadeIn('slow'); }, error: function(data) { ajaxErrorResponse = data.responseText; $('#message').html("<?php echo $this->errorAjax; ?> "); }, dataType: 'json' }); }); <?php return ob_get_clean(); }