[eluser]julian0008[/eluser]
Hi guys. im just new in CodeIgniter but quite knowledgeable in Web Development. Im just having trouble on how I can change the contents of a certain <div> using jQuery depending on what I click on my horizontal menu wihout refreshing the whole page.
For example, if I click the Home tab in my horizontal menu, the div below will change. And when i click another option on the menu, it would again change into another without reloading the page. Below is my jQuery code but it doesnt work. #changer is the dynamic div and v-menu is the menu bar.
Code:
$(document).ready(function()
{
$('#changer').html("<?php $this->load->view('tutorial-contents/page1'); ?>");
$('ul#v-menu li a').click(function()
{
var page = $(this).attr('href')
$('#changer').html("<?php $this->load->view('tutorial-contents/" + page + "'); ?>");
return false;
});
});
I really need help on this. Any reply would be gladly appreciated and sorry for my poor english.