Caman was used before it was defined

522 Views Asked by At

In my HTML I have the following scripts in the header:

<script type="text/javascript" src="scripts.js"></script>
<script type="text/javascript" src="js/caman.full.js"></script>

and in my Javascript file (scripts.js) I tried to do the following code snippet:

Caman("#myImage", function () {
this.brightness(5);
}

As the title says, I get the error Caman was used before it was defined. I'm not sure if there's something obvious that I'm missing or doing incorrectly, but any advice would be appreciated.

1

There are 1 best solutions below

1
On

The Caman script needs to be included first like this:

<script type="text/javascript" src="js/caman.full.js"></script>
<script type="text/javascript" src="scripts.js"></script>

Then in your script you are missing the last );:

Caman("#myImage", function () {
this.brightness(5);
});

If that doesn't work there may be something else in your code that is causing problems.