TinyMce - 多个实例IE7 / 8

时间:2012-07-26 15:26:12

标签: internet-explorer tinymce

这只发生在IE7和8中,但IE的控制台日志说

SCRIPT5007: Unable to get value of the property 'nodeName': object is null or undefined 

它似乎初始化了第一个textarea而不是其余的。

我的代码如下:

if ( $.fn.tinymce ) {
    $('textarea.tinymce').tinymce({
        // Location of TinyMCE script
        script_url : admin_includes + 'tiny_mce/tiny_mce.js',

        // General options
        theme : "advanced",
        skin : "thebigreason",
        plugins : "autolink,lists,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,advlist",

        // Theme options
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist",
        theme_advanced_buttons2 : "styleselect,formatselect,fontselect,fontsizeselect,pastetext,fullscreen,image,link",
        theme_advanced_buttons3 : '',
        theme_advanced_buttons4 : '',
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        relative_urls : false, 
        remove_script_host : false,

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : admin_includes + "lists/link_list.php",
        external_image_list_url : admin_includes + "lists/image_list.php",
        media_external_list_url : "lists/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        },

        oninit : function(){
            $('.tabs').each(function(){
                var tbs = $(this);
                $('ul:first li:first', tbs).addClass('active');
                $('ul:first li', tbs).bind('click', function(){
                    $('ul:first li', tbs).removeClass('active');
                    $(this).addClass('active');
                    $('.tab:visible', tbs).hide();
                    $('.tab:eq(' + $(this).index() + ')', tbs).show();
                });
                var $h = 0;
                $('.tab', tbs).each(function(){
                    $h = ( $(this).height() > $h ? $(this).height() : $h );              
                });
                $('.tab', tbs).height($h);  
                $('.tab:not(:first)', tbs).hide();  
                $('.tab:eq(0)', tbs).show();
            }); 
            $('.tinymce-wrapper').each(function(){
                var $this = $(this);
                $this.prepend('<div class="tinymce-full"></div>');
            });
        }

    });
}

我已注释掉整个块,并且没有显示错误。我已经取消注释并注释掉了onInit函数但仍然会发生。我用Google搜索,什么也没找到。还有其他人经历过这个吗?

问候

0 个答案:

没有答案