admin管理员组文章数量:1422062
I'm using TinyMCE (v3.5.8) and integrated iBrowser plugin (v1.4.5) with Codeigniter 2.1.3 and i'm getting the JavaScript error Uncaught TypeError: Cannot set property 'isMSIE' of null
Please help me to solve this.
Thanks.
EDIT
Error is in iBrowser plugin.
I didn't changed anything as from the downloaded file.
Error occurring in editor_plugin.js in iBrowser plugin folder.
iBrowser plugin url : .html
editor_plugin.js contains below code.
ib = null;
(function() {
tinymce.create('tinymce.plugins.IBrowserPlugin', {
init : function(ed, url) {
// load mon script
tinymce.ScriptLoader.load(url + '/interface/mon.js');
// Register mands
ed.addCommand('mceIBrowser', function() {
var e = ed.selection.getNode();
// Internal image object like a flash placeholder
if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) {return}
ib.isMSIE = tinymce.isIE;
ib.isGecko = tinymce.isGecko;
ib.isWebKit= tinymce.isWebKit;
ib.oEditor = ed;
ib.editor = ed;
ib.selectedElement = e;
ib.baseURL = url + '/ibrowser.php';
iBrowser_open();
});
// Register buttons
ed.addButton('ibrowser', {
title : 'iBrowser',
cmd : 'mceIBrowser',
image: url + '/interface/images/tinyMCE/ibrowser.gif'
});
// Add a node change handler, selects the button in the UI when a image is selected
ed.onNodeChange.add(function(ed, cm, n) {
cm.setActive('ibrowser', n.nodeName == 'IMG');
});
},
getInfo : function() {
return {
longname : 'iBrowser',
author : 'net4visions',
authorurl : '',
infourl : '.html',
version : '1.4.0'
};
}
});
// Register plugin
tinymce.PluginManager.add('ibrowser', tinymce.plugins.IBrowserPlugin);
})();
Sorry. Its a long code.
NOTE : TinyMCE is working well but this plugin has some errors.
I'm using TinyMCE (v3.5.8) and integrated iBrowser plugin (v1.4.5) with Codeigniter 2.1.3 and i'm getting the JavaScript error Uncaught TypeError: Cannot set property 'isMSIE' of null
Please help me to solve this.
Thanks.
EDIT
Error is in iBrowser plugin.
I didn't changed anything as from the downloaded file.
Error occurring in editor_plugin.js in iBrowser plugin folder.
iBrowser plugin url : http://seoroot./blog/puting/programming/tinymce-ibrowser-plugin.html
editor_plugin.js contains below code.
ib = null;
(function() {
tinymce.create('tinymce.plugins.IBrowserPlugin', {
init : function(ed, url) {
// load mon script
tinymce.ScriptLoader.load(url + '/interface/mon.js');
// Register mands
ed.addCommand('mceIBrowser', function() {
var e = ed.selection.getNode();
// Internal image object like a flash placeholder
if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) {return}
ib.isMSIE = tinymce.isIE;
ib.isGecko = tinymce.isGecko;
ib.isWebKit= tinymce.isWebKit;
ib.oEditor = ed;
ib.editor = ed;
ib.selectedElement = e;
ib.baseURL = url + '/ibrowser.php';
iBrowser_open();
});
// Register buttons
ed.addButton('ibrowser', {
title : 'iBrowser',
cmd : 'mceIBrowser',
image: url + '/interface/images/tinyMCE/ibrowser.gif'
});
// Add a node change handler, selects the button in the UI when a image is selected
ed.onNodeChange.add(function(ed, cm, n) {
cm.setActive('ibrowser', n.nodeName == 'IMG');
});
},
getInfo : function() {
return {
longname : 'iBrowser',
author : 'net4visions.',
authorurl : 'http://net4visions.',
infourl : 'http://net4visions./ibrowser.html',
version : '1.4.0'
};
}
});
// Register plugin
tinymce.PluginManager.add('ibrowser', tinymce.plugins.IBrowserPlugin);
})();
Sorry. Its a long code.
NOTE : TinyMCE is working well but this plugin has some errors.
Share Improve this question edited Feb 16, 2013 at 5:03 Mansoorkhan Cherupuzha asked Feb 16, 2013 at 4:41 Mansoorkhan CherupuzhaMansoorkhan Cherupuzha 1,7611 gold badge24 silver badges45 bronze badges 2- 3 Alright, just give me a few hours to set up a local instance exactly like that. Or, post the code where the error was thrown. Examine the call stack and see if it originated in your code. Then post your code. – alex Commented Feb 16, 2013 at 4:44
- I'll edit my question now – Mansoorkhan Cherupuzha Commented Feb 16, 2013 at 4:45
2 Answers
Reset to default 2The culprit is the first line of the code:
ib = null;
null
cannot be accessed as an object. That will throw a TypeError
as you've seen. The fix, I assume, would be to change this line to:
ib = {};
That way it is an object and can have its isMSIE
property set.
However, I'm a little puzzled why this was explicitly set to null
. I'd try changing that line of code and seeing if that breaks something, because there possibly could've been a reason for ib
to initially be null.
In the file editor_plugin.js (located in ibrowser root plugin folder) mented out the line:
tinymce.ScriptLoader.load(url + '/interface/mon.js');
and add this
$.getScript(url+'/interface/mon.js');
Do the same for editor_plugin_src.js as well.
Should be fixed. The fix by @PhpMyCoder will work too. :)
本文标签: javascriptTinyMCE editorUncaught TypeError Cannot set property 39isMSIE39 of nullStack Overflow
版权声明:本文标题:javascript - TinyMCE editor : Uncaught TypeError: Cannot set property 'isMSIE' of null - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745350767a2654752.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论