简体   繁体   English

如何使用JQuery在Bootstrap模式下预览CKEditor内容

[英]How to preview CKEditor content on Bootstrap modal using JQuery

I want to get an input from users using CKEditor textarea and that value should be displayed on a Bootstrap Modal without post back the page. 我想从使用CKEditor textarea用户那里获得输入,并且该值应显示在Bootstrap Modal上,而无需回发页面。 I'm using jQuery . 我正在使用jQuery

How can I implement that? 我该如何实施?

This is my code: 这是我的代码:

$(document).ready(function() {
  $("#btnPreview").click(function() {
    var content = CKEDITOR.instances['editor1'].getData();
    $('#display_div').val(content);
  });
});

使用jQueryhtml()函数。

$('#display_div').html(content);

I think you meant: 我想你的意思是:

$( '#display_div' ).html(content);

instead of 代替

$( '#display_div' ).val(content);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM