I have a wysihtml box and I want to fill its value after an ajax call
$("#<%=txtDescrizioneBreveCategoria.ClientID%>").wysihtml5();
function ModificaCategoria(id) {
$.ajax({
url: "Categorie.aspx/GetCategoria",
type: 'POST',
dataType: "json",
data: JSON.stringify({ 'id': id }),
contentType: 'application/json; charset=utf-8',
cache: false,
async: false,
processdata: true,
traditional: true,
success: function (data) {
var c = data.d;
//we need to parse it to JSON
c = $.parseJSON(c);
$('#<%=txtTitleCategoria.ClientID%>').val(c.Title);
$('#<%=txtDescrizioneBreveCategoria.ClientID%>').val(c.Descrizione);
}
});
}
I already tried with
$('#<%=txtDescrizioneBreveCategoria.ClientID%>').contents().find('body').html('<b>New text</a>');
and with
$('#<%=txtDescrizioneBreveCategoria.ClientID%>').html(c.Descrizione);
and with
var editorObj = $("#<%=txtDescrizioneBreveCategoria.ClientID%>").data('wysihtml5');
var editor = editorObj.editor;
editor.setValue(c.DescrizioneBreve);
but editor variable is always undefined I'm using wysihtml5x v0.4.15 link here
$("#<%=txtDescrizioneBreveCategoria.ClientID%>").wysihtml5();
return you? I think that should return you the editor object – Suction