[英]using ajax how can I display the data from a query in ckeditor
Hello this is my code but i can't see my query data in my ckeditor, can you help me你好,这是我的代码,但我在我的 ckeditor 中看不到我的查询数据,你能帮我吗
function mostrar(idnoticia){ $.post("../ajax/editor.php?op=mostrar",{idnoticia : idnoticia}, function(data,status) { data=JSON.parse(data); mostrarform(true); var Dto = data.editor; function mostrar(idnoticia){ $.post("../ajax/editor.php?op=mostrar",{idnoticia : idnoticia}, function(data,status) { data=JSON.parse(data); mostrarform(true) ); var Dto = data.editor;
CKEDITOR.instances.myeditor.setData(Dto);
$("#titulo").val(data.titulo);
$("#descripcion").val(data.descripcion);
$("#departamento").selectpicker('refresh');
$("#fecha_hora").val(data.fecha_hora);
$("#idnoticia").val(data.idnoticia);
})
} }
This is the form这是表格
<textarea class="form-control" id="myeditor" name="myeditor"></textarea>
</form>
<script type="text/javascript">
CKEDITOR.replace( 'myeditor', {
height: 300,
filebrowserUploadUrl: " ajaxfile.php?type=file",
filebrowserImageUploadUrl: "ajaxfile.php?type=image"
} );
</script>
Try this,尝试这个,
app.get('/profileface', isLoggedIn, function(req, res) {
// mongoose operations are asynchronous, so you need to wait
PracticeModel.find({}, function(err, data) {
// note that data is an array of objects, not a single object!
res.render('profileface.ejs', {
user : req.user,
practices: data
});
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.