Jump to content

loading CKFinder 2.x with jQuery


micah1701

Recommended Posts

With 1.x versions of CKFinder, I've had great success implementing the file browsing application by simply doing something like:

<button id="saveImage">Browse...</button>
<script type="javascript">
$(document).ready(function() {

$('#saveImage').click(function() {
		CKFinder.Popup( { BasePath : '/ckfinder/', 
						  SelectFunction : setImageFilePath,  
						  startupFolderExpanded: true
						});
		return false;
});	

});
</script>

 

But swapping out version 1.4 for 2.0, this doesn't work and I get the error "CKFinder.Popup is not a function."

If I call CKFinder without jQuery using the standard code it works, so I know its there.  And its finding the CKFinder object.

alert(CKFinder.version);

this returns "2.0.4" so I just don't get what I'm missing or doing wrong.

 

And, I know I have jQuery working because I'm using it elsewhere in my app.  In fact, when I do this

<textarea name="editor" id="editor">wysiwyg</textarea>
    <script type="text/javascript">
    $('#editor')
        .ckeditor(function()     { CKFinder.SetupCKEditor(this,'/ckfinder/'); 
                
                                }, 
                                { skin : 'office2003' }
                     )};
    </script>

it loads CKEditor, just without CKFinder (and gives the error "CKFinder.SetupCKEditor is not a function")

 

Any ideas on what I'm missing or doing wrong?  :shrug:

This has been driving me nuts all week and I've had very little luck with the documentation or searching other forums.

Link to comment
Share on other sites

  • 1 month later...

:o I can't believe it was that simple.  All the documentation (which I'm guessing is for version 1.x) shows it with a capital 'S' -- and its always worked that way in the old version.  I can't believe it was so hard for me to find the answer to my problem, you'd think other people would have the same issue.  :shrug:

 

There was another place I was having trouble using CKFinder, without CKeditor, but based on this new knowledge, I changed:

CKFinder.Popup( { BasePath : '/ckfinder/' });

to

CKFinder.popup( { BasePath : '/ckfinder/' });

 

and what'dya know it works!

 

:D THANK YOU SO MUCH!!!  :D

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.