Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/451.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.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 我如何解决这个问题;“所需对象”;TinyMCE和Internet Explorer 8出现错误消息_Javascript_Jquery_Internet Explorer 8_Tinymce - Fatal编程技术网

Javascript 我如何解决这个问题;“所需对象”;TinyMCE和Internet Explorer 8出现错误消息

Javascript 我如何解决这个问题;“所需对象”;TinyMCE和Internet Explorer 8出现错误消息,javascript,jquery,internet-explorer-8,tinymce,Javascript,Jquery,Internet Explorer 8,Tinymce,我将TinyMCE 3.5与jQuery插件一起使用 我正在使用tinyMCE.init()方法,没有指定模式,然后使用以下命令将编辑器附加到我的元素: tinyMCE.execCommand('mceToggleEditor',false,jQuery(this).attr('id')); 编辑器在internet explorer 8中成功加载,但抛出“需要对象”错误 第22行的ForceBlocks.js抛出错误,如下所示: 21 while (node != rootNode) { 2

我将TinyMCE 3.5与jQuery插件一起使用

我正在使用tinyMCE.init()方法,没有指定模式,然后使用以下命令将编辑器附加到我的元素:

tinyMCE.execCommand('mceToggleEditor',false,jQuery(this).attr('id'));
编辑器在internet explorer 8中成功加载,但抛出“需要对象”错误

第22行的ForceBlocks.js抛出错误,如下所示:

21 while (node != rootNode) {
22   if (blockElements[node.nodeName])
23     return;
24 
25   node = node.parentNode;
26 }
firefox、chrome或safari中不会出现错误

tinyMCE.execCommand方法的上下文是:

ADMIN = {
  triggerTextArea: function (event) {

    currentTarget = event.currentTarget;

    if(jQuery(currentTarget).hasClass('ajaxform'))
    {
      textareas = jQuery(this).find('.question-text-editor textarea');
      addTextArea = true;
    } else {
      textareas = jQuery(this).closest('.question-wrapper').find('.question-text-editor textarea');    
      addTextArea = (jQuery(this).is(':checked') && jQuery(this).val() == 'html');
    }


    if(addTextArea == true)
    {
      textareas.each(function() {
          console.log(jQuery(this).attr('id'));
          tinyMCE.execCommand('mceToggleEditor',false,jQuery(this).attr('id'));

        });



    } else {
      textareas.each(function() {
        editorId = jQuery(this).attr('id');
        tinymce.get(editorId).hide(); 
      });

    }
  }
}

  if(addTextArea == true)
  {
    textareas.each(function() {
        console.log(jQuery(this).attr('id'));
        tinyMCE.execCommand('mceToggleEditor',false,jQuery(this).attr('id'));

      });



  } else {
    textareas.each(function() {
      editorId = jQuery(this).attr('id');
      tinymce.get(editorId).hide(); 
    });

  }
}
}

forced_root_块
包含在。对于IE,如果在execCommand加载事件后编辑器不能立即使用,则有必要对文档进行修改。

我可以通过向
tinyMCE.init()
方法添加:
forced\u root\u block:null
来解决此问题,但我不确定这为什么会在internet explorer中导致错误。