迅睿框架 版主:迅睿框架研发组
修改移动端域名后,报错了 baidu is not defined
类型:迅睿CMS 更新时间:2025-10-15 09:18:35

我再pc上使用这个插件是没有问题

代码如下

<?php echo dr_field_form([
 'name' => '内容',
 'ismain' => 1,
 'fieldtype' => 'Ueditor',
 'fieldname' => 'content',
 'setting' => array('option' => array( 'mode' => 3, 'height' => 220, 'width' => '100%', 'tool' => IS_PC ? '\'undo\', \'bold\', \'forecolor\'' : '\'undo\', \'bold\''), 'validate' => array('xss' => 1))
 ]);
?>

image

但是到了移动端后发现 前端控制台报错了 "Uncaught ReferenceError: baidu is not defined"

代码是一样的

          <?php echo dr_field_form([
            'name' => '内容',
          'ismain' => 1,
          'fieldtype' => 'Ueditor',
          'fieldname' => 'content',
          'setting' => array('option' => array( 'mode' => 3, 'height' => 220, 'width' => '100%', 'tool' => IS_PC ? '\'undo\', \'bold\', \'forecolor\'' : '\'undo\', \'bold\''), 'validate' => array('xss' => 1))
          ]);
          ?>

这个问题的出现是的时期是,我将移动端和pc端分别给了不同的域名,就出现了这样的结果

回帖
  • 迅睿官方技术专家
    #1楼    迅睿官方技术专家
    2025-10-13 18:08:57
    iPhone手机 0
    说明百度编辑器没有加载成功,检查下来,域名检查下目录有没有编辑器文件,如果没有的话,就手动复制一份
  • 小黄人 18html
    #2楼    小黄人 18html
    2025-10-13 19:48:07
    Chrome 0
    你应该把红色那个抬头截图出来的,那里会报路径
  • xyd99
    #3楼    xyd99
    2025-10-14 09:04:17
    Chrome 0
    小黄人 18html
    image
    是这个吗
  • xyd99
    #4楼    xyd99
    2025-10-14 19:31:16
    Edge 0
    迅睿官方技术专家 我再移动端其他页面使用这个富文本编辑器是可以使用的但是只有这个页面无法使用
    image
    pja.html模版
            {if $member && dr_in_array(2, $member['groupid'])}
            <form action="" method="post" id="myform_comment" class="comment-form" style="box-sizing: border-box;">
              {dr_form_hidden()}
              <input type="hidden" name="is_ajax" value="1">
              <input type="hidden" name="catid" value="{$catid}">
              <div id="respond-textarea">
              <?php echo dr_field_form([
                               'name' => '内容',
                             'ismain' => 1,
                             'fieldtype' => 'Ueditor',
                             'fieldname' => 'content',
                             'setting' => array('option' => array( 'mode' => 3, 'height' => 150, 'width' => '100%', 'tool' => IS_PC ? '\'undo\', \'bold\', \'forecolor\'' : '\'undo\', \'bold\''), 'validate' => array('xss' => 1))
                             ]);
                             ?>
              </div>
                </div>
              <button class="flex-col justify-start items-center button_6" id="comment_submit" onclick="dr_bbs_comment()" type="button" style="outline: none;border: none;color: #fff;font-size: 1.25rem;    line-height: 1.22rem;width: 100%; margin-top: 15px;">发表</button>
            </form>
            {/if}
  • 迅睿官方技术专家
    #5楼    迅睿官方技术专家
    2025-10-15 00:33:03
    Chrome 0
    你这是ajax加载了,百度编辑器不支持这种ajax的方式加载
  • xyd99
    #6楼    xyd99
    2025-10-15 08:54:46
    Edge 0
    迅睿官方技术专家 问题我的pc端是可以通过ajax加载是可以的呀pc端
    image
    pja.html
        {if $member && dr_in_array(2, $member['groupid'])}
                  <form action="" method="post" id="myform_comment" class="comment-form" style="padding: 0 15px;    box-sizing: border-box;">
                    {dr_form_hidden()}
                    <input type="hidden" name="is_ajax" value="1">
                    <input type="hidden" name="catid" value="{$catid}">
                    <div id="respond-textarea">
                      <?php echo dr_field_form([
                              'name' => '内容',
                            'ismain' => 1,
                            'fieldtype' => 'Ueditor',
                            'fieldname' => 'content',
                            'setting' => array('option' => array( 'mode' => 3, 'height' => 220, 'width' => '100%', 'tool' => IS_PC ? '\'undo\', \'bold\', \'forecolor\'' : '\'undo\', \'bold\''), 'validate' => array('xss' => 1))
                            ]);
                            ?>
                          </div>
                    <p class="form-submit" style="margin-top: 20px; text-align: right; margin-bottom: 20px;">
                      <button class="color button dark_button medium button_4" id="comment_submit" onclick="dr_bbs_comment()" type="button" style="outline: none;border: none;color: #fff;font-size: 1.25rem;    line-height: 1.22rem;">回复</button>
                    </p>
                  </form>
                  {/if}
  • 迅睿官方技术专家
    #7楼    迅睿官方技术专家
    2025-10-15 09:18:35
    Chrome 0
    那你就找个会前端人帮你看看是什么原因了