【问题标题】:Cl editor not working in default-modal PopupCl 编辑器在默认模式弹出窗口中不起作用
【发布时间】:2017-06-02 13:13:14
【问题描述】:

为什么 Cl Editor 不能在 Popup 中工作。有时可能是它的工作

这是我可以使用 ajax 在弹出窗口中运行的代码: 它可能是一些时间工作或一些时间不能工作: List.php 可以显示工作列表。在 tr td 标签上。

列表.php

<div id="default-modal" class="modal fade" tabindex="-1" role="dialog"></div>
<td  width="5%" class="text-center"><a onclick="show_popup(<?php echo $id; ?>)" rel="<?php echo $id; ?>"  class="btn btn-default btn-xs btn-icon"><i class="icon-file6"></i></a></td>

<script type="text/javascript">

function show_popup(id)
{
   $('#default-modal').modal('show');
   $.ajax({
      url: 'job_popup.php',
      type: 'post',
      data: {id:id},
      cache: false,
      success: function(response)
       {
        $('#default-modal').html(response);
       }
 });

}

job_popup.php

<link rel="stylesheet" href="cleditor/jquery.cleditor.css" />
<script src="cleditor/jquery.cleditor.js"></script>
<script src="cleditor/jquery.cleditor.min.js"></script>
<script>
    $(document).ready(function () {
     $("#desc").cleditor();
          });
    $('.form-control').each(function(){
this.contentEditable = true;
  });
</script>



 <textarea rows="5" cols="5" name="desc" id="desc" class="form-control"><?php echo $desc?> </textarea>

【问题讨论】:

  • 看不到&lt;input id="input"&gt;
  • 我用 desc 替换。但我解决不了
  • 你为什么要初始化cleditor两次?删除第一个呼叫,然后重试。另外,当你使用 jQuery .each 时,你应该使用 $(this) 而不是 this
  • 等等……我试试
  • 没有工作的兄弟。请给我另一个解决方案

标签: javascript jquery mysql popup cleditor


【解决方案1】:

尝试在弹出的点击事件中添加编辑器的 jQuery 代码(在 document.ready 函数中)。

【讨论】:

  • 在此处添加您的代码并弹出窗口,以便我可以为您提供更多帮助。
  • 你好现在可以看到
  • $.ajax({ url: 'job_popup.php', type: 'post', data: {id:id}, cache: false, success: function(response) { $('# default-modal').html(response); $("#desc").cleditor(); $("#desc").cleditor({ fonts: // 字体弹出窗口中的字体名称 "Arial,Arial Black, Comic Sans MS,Courier New,Narrow,Garamond," + "Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana"+ "400 20px/30px 'Roboto', sans-serif" });} }) ;
  • 在 show_popup 函数中用上面的 ajax 替换并检查。
  • 并删除 $("#desc").cleditor();从弹出页面?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-18
  • 2023-03-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多