0

Simple problem (or so it seems). CKEditor works fine. But when I dropped in CKFinder, I get the error, "CKFinder is not a constructor" when attempting the follow:

var finder = new CKFinder();
finder.basePath = '/includes/ckfinder/';
finder.create();

Well, basically it's the first line that causes it, rendering the others pointless. This is copied/pasted directly from the CK website, minus the change in basepath.

If I do a View Source on the page in Chrome, I can click on the link for ckfinder.js and it opens a tab and shows that it's there. Yet it just doesn't work.

For the sake of completeness, here's the script tag:

<script type="text/javascript" src="/includes/ckfinder/ckfinder.js"></script>

What have I done wrong?

RobG
  • 576
  • 2
  • 9
  • 21
  • 2
    looking at [documentation](http://docs.cksource.com/ckfinder3/#!/guide/dev_plugins) the error is correct - CKFinder is not a constructor – Jaromanda X Jul 24 '17 at 00:50
  • so you're saying their example code is wrong? If you look in ckfinder.js, it starts with: var CKFinder=function(){ – RobG Jul 24 '17 at 00:54
  • I don't know who "they" are or where your sample code is from - I only looked at the documentation for CKFinder 3 - but it may be that the documentation I found was for something unrelated to your issue - as it mentions CKfinder plugins rather than just ckfinder - perhaps if you provided a link to where you got the code from? – Jaromanda X Jul 24 '17 at 00:55
  • http://docs.cksource.com/CKFinder_2.x/Developers_Guide/ColdFusion/Integration/JavaScript The version it gave me is 2.6.2.1. It seems the only way to get v3 is to use the php or .NET version. – RobG Jul 24 '17 at 01:12

1 Answers1

0

Figured it out. It wasn't clear at all when I downloaded the trial that it's serving either v3 or v2 of the code. I had installed v3 and was using the JavaScript API, which is v2. Once I put the v2 code in place, the error went away.

RobG
  • 576
  • 2
  • 9
  • 21