I am trying to load my controllerMostrarMayorContenido in to an area(div ) on my page(index) and I can load pure text all, I read that It is using .html, It just retrieving the contents of my controller and paste it in index.php, I already do it in mootools but I dont find a way in jquery, It does not work
the problem is with this line document.getElementById('divrespuesta2').innerHTML= texto;
in moootools It works
var prueboRequest = new Request({
method: 'POST',
// data: 'id_tema='+id_tema,
url: '../controller/controllerTema/controllerMostrarMayorContenido.php',
onRequest: function() {},
onSuccess: function(texto, xmlrespuesta){
document.getElementById('divrespuesta2').innerHTML= texto; this line
},
onFailure: function(){alert('Fallo');}
}).send();
}
in jQuery no
function limpiarDiv(id_tema){
document.getElementById("divrespuesta2").innerHTML="";
document.getElementById("divrespuesta3").innerHTML="";
$.ajax({
type: "POST",
url: '../controller/controllerTema/controllerMostrarMayorContenido.php',
beforeSend:function(){alert('ejecutandose');},
success: function(){
//document.getElementById('divrespuesta2').innerHTML= texto;
$('#divrespuesta2').html('texto');
}
});
}