Redirect on click to the codeigniter controller

I am trying to redirect a user to a page when he clicks a div. I wanted to know how doI redirect the user to the CI's new controller from the html view?

Thank YOu

Answers


Add the following code in your html view,

$(function(){
 $('#div_id').on('click',function(){
    window.location.href = "<?php echo site_url('new_controller'); ?>";
 });
});

Do change the div_id and new_controller to suit your need.


Need Your Help

iPhone: Execute code after animation of UIDeviceOrientation change finishes

iphone animation ipad rotation

Not sure if I can explain this correctly, but I am trying to execute a method device orientation animation finishes. Right now I have [[NSNotificationCenter defaultCenter] addObserver:self