quiero hacer un tipo foro parecido a este... que aparesca un textarea con tinyMCE y lo guarde con formato HTML en la base de datos.. pero lo quiero hacer con ajax
En la página del tinyMce viene el sig. codigo:
Cita: function ajaxSave() {
var ed = tinyMCE.get('content');
// Do you ajax call here, window.setTimeout fakes ajax call
ed.setProgressState(1); // Show progress
window.setTimeout(function() {
ed.setProgressState(0); // Hide progress
alert(ed.getContent());
}, 3000);
}
y yó modifique el script para que lo envíe hacia un php... pero no funciona...
el codigo que desarrollé fue:
Cita: function objetoAjax()
{
var xmlhttp=false;
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E)
{
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
{
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function ajaxSave()
{
var ed = tinyMCE.get('msjtext');
var div = document.getElementById('resultado')
ajax.open("POST", "procesar.php");
ajax.onreadystatechange=function()
{
if (ajax.readyState==4)
{
div.innerHTML = ajax.responseText
}
}
//enviando los valores
ajax.send("mensaje="+ed.getContent());
}
pero no funciona.. me deja de mostrar el tinyMCE y no envía nada al php.
AYUDA!