Error with jQuery Colorpicker

Asked

Viewed 122 times

2

I’m using the jQuery Colorpicker only this giving the following error:

Uncaught Typeerror: Object [Object Object] has no method 'Colorpicker'

My code is like this:

<html>
    <head>
        <script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script>
        <script type="text/javascript" src="/js/jquery-ui-1.10.4.custom.min.js"></script>
        <script type="text/javascript" src="/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="colorpicker/js/colorpicker.js" charset="utf-8"></script>
        <script type="text/javascript" src="colorpicker/js/eye.js" charset="utf-8"></script>
        <script type="text/javascript" src="colorpicker/js/utils.js" charset="utf-8"></script>
    </head>
    <body>
        <div id="style-colors">
            <div class="cores">
                <label for="">Cor</label>
                <div class="sc-background">
                    <div style="background-color: #0000ff"></div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(document).ready(function(){
                $('.sc-background').ColorPicker();
            });
        </script>
    </body>
</html>

Someone can help me with this mistake?

  • Enter here > http://www.digitalmagicpro.com/jPicker/

  • this one is too big, gets ugly, has to be something more subtle @Samirbraga

  • The error you are receiving gives me the idea that the . js file did not load. You can confirm that your url is correct?

2 answers

1

I downloaded the jQuery Colorpicker package and saw that the jQuery file that comes in it is version 1.3.2.

Version 1.10 has major changes compared to 1.3.2, so try loading the jQuery file from the downloaded package along with jQuery Colorpicker, to 1.3.2 to confirm that the problem is not caused by it.

0

Uncaught Typeerror: Object [Object Object] has no method 'Colorpicker'

This error occurred because the Colorpicker library was not included correctly, I recommend as opposed to using a library use the "new input" <input type="color" /> with a Polyfill like the Spectrum for example.

Also, I found on jQuery UI’s Wikipedia an article talking about this, (here), he quotes some libraries that should fit his preferences.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.