Saturday, 24 August 2013

Codeignter: Open another page with jQuery

Codeignter: Open another page with jQuery

Issue seems pretty simple but somehow it is not working for me. There is a
user image on index page. Onclick of this image, user profile page should
appear.
index.php
$('#user-navbar').click(function () {
$.ajax({
url: "<?php echo site_url('gallery/userProfile');?>",
type: 'GET'
});
});
gallery Controller
function userProfile()
{
$this->load->view('userprofile');
}
When I click on the user image nothing happens. Right now I am not passing
any data to userprofile page. Just want to show that page.

No comments:

Post a Comment