0

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...

2
  • it must have something to do with CKeditor running in an iFrame ? Commented Jun 18, 2010 at 10:22
  • the solution will be: finding a way to get to the original document where the ckeditor iframe is residing and calling the function there. Don't know how to get the document though... Commented Jun 18, 2010 at 10:45

1 Answer 1

1

now that was easy.

parent.openAssetsBrowser() did the trick!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.