我正在使用tinyMCE库来处理我的文本,同时也用于图像上传,但是当它们都在一个页面上时,它就不能工作了。如果它是单独的,这是很好的,但只要我在页面上放置一个tinyMCE文本区和一个启动图像管理器对话框的按钮,对话框就会加载,但旋转的加载图标只是继续运行,而不是从我的根路径加载文件。
在我的文档标题中,我有:
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
editor_selector : "mceEditor",
editor_deselector : "mceNoEditor",
plugins : "style,advlink,inlinepopups,preview,contextmenu,paste,directionality,fullscreen,noneditable,imagemanager,media",
// Theme options
theme_advanced_buttons1 : "cut,copy,paste,pastetext,pasteword,|,undo,redo,|,link,unlink,code,|,fullscreen",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_buttons4 : "",
theme_advanced_toolbar_location : "bottom",
theme_advanced_toolbar_align : "center",
theme_advanced_resizing : false,
media_strict: false
});这对我的文本来说很棒,然后在document.ready()上使用jQuery,我有以下上传内容:
$('.add_image_button').click(function(){
mcImageManager.open(''{
rootpath : '{0}/',
oninsert:function(o){
var location = o.focusedFile.path;
location = location.substr(4);
location = '_uploads/'+location;
var preview_image = '../' + location;
$('#selected_image > img').attr('src', preview_image);
$('#image_path').val(location);
}
});
return false;
});如果我在页面上有一个MCE文本区域,并按下我的上传图像按钮,我会得到以下javascript错误:
未捕获的TypeError:无法设置null - editor_plugin.js:1未捕获的TypeError的属性“”innerHTML“”:无法调用未定义的index.php:1的方法“”getArgs“”
我在DOM ready之后尝试过tinyMCE.init(),但没有找到joy。
感觉上可能存在某种路径配置冲突,比如imagemanager。有没有人知道是否有一种方法可以在imagemanager上查看根路径是否出了问题?
干杯
发布于 2012-06-14 18:20:53
如果有人碰到这个..。我通过从插件列表中删除inlinepopup修复了这个问题。
https://stackoverflow.com/questions/10368516
复制相似问题