Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/425.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 文本编辑器(ckeditor)在我的DIV框内不工作_Javascript_Jquery_Html_Ckeditor - Fatal编程技术网

Javascript 文本编辑器(ckeditor)在我的DIV框内不工作

Javascript 文本编辑器(ckeditor)在我的DIV框内不工作,javascript,jquery,html,ckeditor,Javascript,Jquery,Html,Ckeditor,嗨,我有一个div框,它在我的页面上打开,然后加载一个html文件,其中包含用于处理文本区域的CKeditor。问题是,如果我在浏览器中查看html文件,一切正常,我拥有所有的编辑选项。当我在JS脚本中使用它时,我什么也得不到。有人能帮我吗 执行此操作的JS代码在这里 $(document).ready(function(){ $('#'+divbox).load('../customer_rm/display_email_send.php', f

嗨,我有一个div框,它在我的页面上打开,然后加载一个html文件,其中包含用于处理文本区域的CKeditor。问题是,如果我在浏览器中查看html文件,一切正常,我拥有所有的编辑选项。当我在JS脚本中使用它时,我什么也得不到。有人能帮我吗

执行此操作的JS代码在这里

        $(document).ready(function(){ 

              $('#'+divbox).load('../customer_rm/display_email_send.php', function() {
                      // once loaded 
                    CKEDITOR.replace( 'mail_body' );
工作的HTML文件在这里

    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml'>

    <head>
    <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
    </head>
    <body>


    <style type='text/css'>
    table.t {border: 1px solid black}
    td, tr {border: 0}

    .bdr {
        border: 4px solid black ;
    }
    .white {
        background-color:#FFF ;
    }

    </style>

    <div align='center'>

    <br><br />

    <table id='t' width='700' border='2' bgcolor='#ccc'>
      <tr >
        <td width='20'>&nbsp;</td>
        <td width='50'>&nbsp;</td>
        <td width='50'>&nbsp;</td>
        <td >&nbsp;</td>
        <td width='20' >&nbsp;</td>    

      </tr>

      <tr>
        <td>&nbsp;</td>
        <td rowspan='3'>
        <input type='button'id='send' value='Send'
        style='width:60px; height:40px '
         /><hr>
        <input type='button' value='Close'
        style='width:60px; height:20px '                        onclick='fadeout()' 
         />
        </td>
        <td><input type='button' value='To :' /></td>
        <td><input type='text' class='white' id='mailto' size='80'  /></td>
        <td>&nbsp;</td>
      </tr> 

      <tr>
        <td>&nbsp;</td>

        <td><input type='button' value='Cc :' /></td>
        <td><input type='text' class='white' id='mailcc' name='mailcc' size='80' /></td>
        <td>&nbsp;</td>
      </tr>  
      <tr>
        <td>&nbsp;</td>

        <td><input type='button' value='Bcc :' id='bcc'  /></td>
        <td><input type='text' class='white' id='mailbcc' size='80' /></td>
        <td>&nbsp;</td>
      </tr>  
      <tr>
        <td>&nbsp;</td>
        <td><input type='button' value='Subject'
        style='width:60px; height:20px '                        onclick='fadeout()' 
         /></td>
        <td colspan='2'><input type='text' class='white' id='subject' size='89' /></td>


        <td>&nbsp;</td>
      </tr>  
      <tr>
        <td>&nbsp;</td>
        <td colspan='3'>
          <textarea  id='mail_body'  class='white'  style='height:380px; width:600px; bgcolor:#fff ' >
          </textarea>
        </td>
        <td>&nbsp;</td>
      </tr>  
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>  
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>  

     </table>


    </div>

表.t{边框:1px纯黑}
td,tr{边界:0}
B.巴西存托凭证{
边框:4倍纯黑;
}
怀特先生{
背景色:#FFF;
}




为什么不使用Jquery调用CKEditor来替换div…看起来更简单:

$( 'textarea' ).ckeditor();
此处参考: