micah1701 Posted October 8, 2010 Share Posted October 8, 2010 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? This has been driving me nuts all week and I've had very little luck with the documentation or searching other forums. Quote Link to comment https://forums.phpfreaks.com/topic/215424-loading-ckfinder-2x-with-jquery/ Share on other sites More sharing options...
micah1701 Posted November 17, 2010 Author Share Posted November 17, 2010 Quote Link to comment https://forums.phpfreaks.com/topic/215424-loading-ckfinder-2x-with-jquery/#findComment-1135592 Share on other sites More sharing options...
brianlange Posted November 17, 2010 Share Posted November 17, 2010 Try using CKFinder.setupCKEditor (lower case s) Here's a working example. I am using the latest version of ckeditor. http://www.gonavygolf.com/ck.php Quote Link to comment https://forums.phpfreaks.com/topic/215424-loading-ckfinder-2x-with-jquery/#findComment-1135792 Share on other sites More sharing options...
micah1701 Posted November 18, 2010 Author Share Posted November 18, 2010 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. 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! THANK YOU SO MUCH!!! Quote Link to comment https://forums.phpfreaks.com/topic/215424-loading-ckfinder-2x-with-jquery/#findComment-1136083 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.