Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter and AJAX
#1

[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("&lt;?php $this->load->view('tutorial-contents/page1'); ?&gt;");

$('ul#v-menu li a').click(function()
{
  var page = $(this).attr('href')
  $('#changer').html("&lt;?php $this->load->view('tutorial-contents/" + page + "'); ?&gt;");
  return false;
});
});


I really need help on this. Any reply would be gladly appreciated and sorry for my poor english.


Messages In This Thread
CodeIgniter and AJAX - by El Forum - 02-21-2013, 07:22 AM
CodeIgniter and AJAX - by El Forum - 02-21-2013, 08:11 AM
CodeIgniter and AJAX - by El Forum - 02-21-2013, 08:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB