I've built a simple CKeditor 3 plugin with one button that should just call a JS-function when somebody clicks it.
The plugin (code when somebody clicks) looks like this and is working:
var openAssetsBrowser = {
exec:function(editor){
openAssetsBrowser();
}
};
I always get the error "openAssetsBrowser is not a function"
The function itself is somewhere in the page, I thought the order shouldn't matter since the whole page is read first, before anyone would lclick the ckeditor button that triggers the function
Calling it on a link somewhere (e.g. with jquery) in the page just works:
$("a#linkOpenFileManager").click(function(){
openAssetsBrowser();
return(false);
});
Does anyone know why the function cannot be called from within the CKeditor plugin?
update: when pasting the complete function code instead of "openAssetsBrowser();" in the plugin, all works, but that's not really re-usable code...