benim denetleyicisi bir javascript işlevi nasıl?

0 Cevap php

Hi I have a form in my view page on submit a function in a controller called function Login() is called This is my Login function

function Login()
{   
     $EmailId = $this->input->post('mailId');
     $Password = $this->input->post('password');
     $res=$this->friendsmodel->CheckLogin($EmailId,$Password);
     if($res==true)
     {

         $_SESSION['Authenticaton_user']="auth_user";
         $this->session->set_flashdata('item', 'Thanks for logging in');
                      //I want to call javascript function from here
         redirect('friends/Display_News');
     }
     else 
     {
      $this->session->set_flashdata('item', 'Username Or Password is invalid');
         redirect('friends');
     }

}

Now want to call a javascript function named topBar() from my if and else statement This is my script

 function topbar(message) 
{
       var alert = $('<div id="alert">'+message+'</div>');
        $(document.body).append(alert);
        var $alert = $('#alert');
        if ($alert.length) {
            var alerttimer = window.setTimeout(function() {
                $alert.trigger('click');
            }, 5000);
            $alert.animate({ height: $alert.css('line-height') || '50px' }, 200).click(function() {
                window.clearTimeout(alerttimer);
                $alert.animate({ height: '0' }, 200);
            });
        }
}

Buradan bir javascript çağırmak nasıl

0 Cevap