[eluser]Peter74[/eluser]
Hi all! learning ci a couple of weeks.. almost ready for start my first proyect, before i want learn ajax, y read the documentation from the site, and learn with Derel Allard and iam try to Update one segment of the page but dont work..
look at this
please
Code:
myfunc.js
window.onload = function(){
$('mainmenu').onclick = function(){
//new Element.update('contenido','static content'); //this work
new Element.update('contenido', base_url+'contenido/menu'); //dont work
return false;
}
}
i think i need to know, how to put a "variable" in the second parameter of the function element.update
Code:
contenido.php
<?php
class Contenido extends Controller{
function index(){
echo "estoy en contenido :D";
}
function menu(){
$select = $this->uri->segment(3);
//this is ok, i load the content of the file... (menu choosen)
$data['contenido'] = $this->load->view('segmentos/'.$select.'_inc.php', '', true);
//echo $data['contenido']; i try with this, no work
//echo $this->input->post($data['contenido']); i try with this, no work
//return $data['contenido']; i try ...
}
}
the view
<?php
$this->load->view('header');
?>
<div id="contenido" class="fila">
<?php echo $contenido; ?>
</div>
<?php
$this->load->view('footer');
?>
Any help or sugestion helpe a lot, very txs for reading and reply