【问题标题】:tinymce and jquerytinymce 和 jquery
【发布时间】:2009-12-11 03:00:10
【问题描述】:

我正在使用 tinymce 和简单模式(jquery 插件)。最初,除非我刷新页面,否则第二个或更多打开的模式对话框不起作用(意味着我无法在文本区域中键入)。现在我更改了我的代码,现在我可以输入,但问题仍然存在,即提交按钮不再起作用。我尝试在 firebug 中进行跟踪,发现一些类似这样的错误

提前致谢

获取属性 XULElement.accessibleType 的权限被拒绝 [打破这个错误] var tinymce={majorVersion:"3",minorVersi...hanged();return true}return false})})();

这是修改后的代码

$(document).ready(function() {  
    $('.basic').click(function (e) {
        e.preventDefault();     
        $('#basic-modal-content').modal({onShow: function (dialog) {
            tinyMCE.init({
                // General options
                mode : "textareas",
                theme : "advanced",
                setup : function (ed) {
                    ed.onKeyPress.add(
                        function (ed, evt) {
                            var y =  tinyMCE.get('test').getContent();
                            $('#rem_char').html(100 - y.length);
                            if (y.length == 100){
                                //ed.getWin().document.body.innerHTML = y.substring(0,100);
                                alert("Your element has exceeded the 100 character limit. If you add anymore text it may be truncated when saved.")
                                return; 
                            }
                        }
                    );
                },          
                plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount",

                // Theme options
                theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
                theme_advanced_buttons2 : "fontselect,fontsizeselect,bullist,numlist,forecolor,backcolor",
                theme_advanced_buttons3 : "",       
                theme_advanced_toolbar_location : "top",
                theme_advanced_toolbar_align : "left",
                dialog_type : "modal"
            }); 
            return false;
        }});
    });
    $('.close').click(function (e) {
        e.preventDefault(); 
        $.modal.close();
    }); 
});    

【问题讨论】:

    标签: jquery tinymce


    【解决方案1】:

    您的 HTML 页面和所有 Javascript 是否从 相同 域调用? (domain.com 和 www.domain.com 是 不同的 域)。

    【讨论】:

    • 嗨 pekka,是的,我使用的是同一个域。谢谢
    • 大家好,我发现与 tinymce 和 jquery 插件验证存在冲突。我试图删除验证然后它工作正常。有什么想法或建议吗?这是我的验证代码 $("#create_school").validate({ debug: true, errorElement: "span", success: function(span) { span.text("ok!"); }, rules: { name: { required:true, minlength:5, }, }, submitHandler: function() { var y = tinyMCE.get('test').getContent(); alert(y.length); alert("Submitted!"); } });
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多