TinyMCE的无法加载内容时,在一个页面在Mozilla呼吁第二次 [英] TinyMCE not able to load content when called for second time in one page in Mozilla

查看:1557
本文介绍了TinyMCE的无法加载内容时,在一个页面在Mozilla呼吁第二次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在文本区域基本上,我已经装了tinyMCE。而我的动机是:

在单击该按钮时,编辑器应该被存放​​在描述填充 通过Ajax调用数据库。

它正常工作的Chrome浏览器。

但是当我运行在Firefox中的脚本,它工作正常的第一次。但在$ P $再次pssing按钮,说明闪烁一秒钟消失。在code工作正常刷新页面。

可能是什么问题?任何帮助将是有益的。

解决方案

  tinymce.init({
        模式:精确,
        选择:your_textarea_selector,
        主题:现代的,
        插件:
              advlist自动链接列表链接图像字符表打印preVIEW主播,
              searchreplace visualblocks code全屏,
              insertdatetime媒体表文本菜单贴
        ]
        工具栏:的i​​nsertFile撤销重做| styleselect |粗斜体| alignleft aligncenter alignright alignjustify | bullist numlist凸出缩进|友情链接的图像,
        toolbar_items_size:'小',
        image_advtab:真正的,
        init_instance_callback:函数(编辑){
            VAR currentEditor = editor.editorContainer;
            $(currentEditor).show();
        }
    });
    如果(tinymce.editors.length大于0){
        tinymce.execCommand('mceFocus',真的,txt_area_id);
        tinymce.execCommand('mceRemoveEditor',真的,txt_area_id);
        tinymce.execCommand('mceAddEditor',真的,txt_area_id);
    }
 

  

这工作正常,我即使Ajax请求。我使用TinyMCE的4.x版在我的JSP。

Basically,I have loaded tinyMCE on the textarea. And my motive is :

When the button is clicked, the editor should be filled by the description stored in database through ajax call.

It works properly in Chrome.

But when I run the script in Firefox,it works fine for the first time. But on pressing the button again, the description flashes for a second and disappears. The code works fine on refreshing the page .

What could be problem? Any help would be helpful.

解决方案

tinymce.init({
        mode : "exact",
        selector: 'your_textarea_selector',
        theme: "modern",
        plugins: [
              "advlist autolink lists link image charmap print preview anchor",
              "searchreplace visualblocks code fullscreen",
              "insertdatetime media table contextmenu paste"
        ],
        toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
        toolbar_items_size: 'small',
        image_advtab: true,
        init_instance_callback : function(editor) {             
            var currentEditor = editor.editorContainer;
            $(currentEditor).show();
        }
    });
    if (tinymce.editors.length>0) {
        tinymce.execCommand('mceFocus', true, txt_area_id);
        tinymce.execCommand('mceRemoveEditor',true, txt_area_id);
        tinymce.execCommand('mceAddEditor',true, txt_area_id);
    }

This works fine for me even with ajax requests. I'm using Tinymce 4.x in my JSP.

这篇关于TinyMCE的无法加载内容时,在一个页面在Mozilla呼吁第二次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆