Welcome Guest, Not a member yet? Register   Sign In
How the use Ajax with Codeigniter?
#1

[eluser]ytsejam[/eluser]
Hello,
I am a newbie developer and I am writing a website with codeigniter. It is really fun about anything I coded. Now my problem is , I use MY_Controller.

Code:
function render_page($view) {
    if( ! $this->input->is_ajax_request() )
    {
      //do this to don't repeat in all controllers...
      $this->load->view('templates/header', $this->data);
      //menu_data must contain the structure of the menu...
      //you can populate it from database or helper
    }
    $this->load->view($view, $this->data);
    if( ! $this->input->is_ajax_request() )
    {
     $this->load->view('templates/menu');
     $this->load->view('templates/footer', $this->data);
    }
  }

My home.php/about.php works without any problems. I want only <div id="content"> part to change when i click about or other links in the navigation menu.
How can i enable the ajax?
Thank you .


Messages In This Thread
How the use Ajax with Codeigniter? - by El Forum - 08-04-2012, 03:12 AM
How the use Ajax with Codeigniter? - by El Forum - 08-04-2012, 11:46 AM
How the use Ajax with Codeigniter? - by El Forum - 08-04-2012, 12:30 PM
How the use Ajax with Codeigniter? - by El Forum - 08-04-2012, 12:39 PM
How the use Ajax with Codeigniter? - by El Forum - 08-04-2012, 12:43 PM
How the use Ajax with Codeigniter? - by El Forum - 08-04-2012, 12:51 PM
How the use Ajax with Codeigniter? - by El Forum - 08-04-2012, 12:51 PM
How the use Ajax with Codeigniter? - by El Forum - 08-04-2012, 01:27 PM
How the use Ajax with Codeigniter? - by El Forum - 08-04-2012, 01:46 PM
How the use Ajax with Codeigniter? - by El Forum - 08-04-2012, 02:55 PM
How the use Ajax with Codeigniter? - by El Forum - 10-16-2012, 09:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB