Loading content in page via jQuery I'm doing a website in CodeIgniter and I'm loading the content page via jQuery, but I don't know if this is a good practice or not. Could I improve it?

jQuery: 

// Another question here: how can I group the repeated code in a function:

$(function() {

var control = '../Indoamericana/Intranet/index/Proceso/';

var loadPage = function(page){
    $(".page-content").load(page);  
};

$("#gestion_directiva").click(function(event) {
    var process = 1;
    loadPage(control + process);
});

$("#gestion_calidad").click(function(event) {
    var process = 2;
    loadPage(control + process);
});

$("#gestion_academica").click(function(event) {
    var process = 3;
    loadPage(control + process);
});


Controller:

/**
* index();
* 
* funcion que carga la información del proceso en la intranet
* @param String $process Identificador del proceso a cargar
* @return Vista del proceso indicado
*/

public function index($process, $idProcess){        

    $data['data'] = $this-&gt;intranet_model-&gt;getProcessInfo($idProcess);
    $data['member'] = $this-&gt;intranet_model-&gt;getMembers($idProcess);
    $data['proceso'] = 'GI7';

    $route = '/Modules/Intranet/';
    $route .= $process;

    $this-&gt;load-&gt;view($route, $data);       
}


View: 

&lt;div class="row"&gt;
    &lt;div class="col-md-12"&gt;
        &lt;h3 class="page-title"&gt;
            &lt;?php foreach ($data as $row): ?&gt;
            &lt;?php echo $row-&gt;name ?&gt;
            &lt;?php endforeach ?&gt;
        &lt;/h3&gt;
        &lt;ul class="page-breadcrumb breadcrumb"&gt;
            &lt;li&gt;
                &lt;i class="icon-home"&gt;&lt;/i&gt;
                &lt;a href="index.html"&gt;Página Principal&lt;/a&gt; 
                &lt;i class="icon-angle-right"&gt;&lt;/i&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;a href="#"&gt;Intranet&lt;/a&gt;
                &lt;i class="icon-angle-right"&gt;&lt;/i&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;a href="#"&gt; 
                    &lt;?php foreach ($data as $row): ?&gt;
                    &lt;?php echo $row-&gt;name ?&gt;
                    &lt;?php endforeach ?&gt;
                &lt;/a&gt;
            &lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt; 
&lt;/div&gt;
You might already know this but you can add a library class called 'template' it allows you to make a kind of a masterpage where you can load all different php files, for example your header - content - footer or anything else, seperately into one page.

Your controller will look like this for example:

 public function example() {
        $partials = array('header' =&gt; 'header', 'navigation' =&gt; 'navigation', 'content' =&gt; 'content');
        $this-&gt;template-&gt;load('masterpage.php', $partials);
    }


Read more at http://ellislab.com/codeigniter%20/user-guide/libraries/parser.html

It's really use to use once you know how it's done.

For example you could use for every page the same navigation but another index and header.

The masterpage looks like this:

&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
    &lt;head&gt;
    &lt;/head&gt;
    &lt;body&gt;
&lt;?php echo $navigation; ?&gt;
&lt;?php echo $header; ?&gt;
&lt;?php echo $content; ?&gt;
        &lt;div id="footer"&gt;
            &lt;div class="container"&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;


The last thing you need to do is search for the library file on the net upload it and autoload the library in your configs, file: autoload or just in the constructor of your controller. I recommend autoloading the template library because you normally use it at every end of a controller to make the full view.