vI am struggling with this problem: i'm currently trying to implement a color picker for my theme admin page (specifically, i am using this one: http://bgrins.github.io/spectrum/ ).
Loading the color picker in the frontend is very easy: i'm just referencing the js file:
<script type="text/javascript" src="wp-content/themes/mytheme/js/spectrum.js"></script>
pasting the script:
<script>
$(".basic").spectrum({
color: "#f00",
change: function(color) {
$("#basic-log").text("change called: " + color.toHexString());
}
});
</script>
and then, obviously, adding the colorpicker field where i need it:
<input type='text' class="basic"/>
It's working perfectly. However, if i try to do the same in my functions.php file, to have it displayed in my backend, it doesn't work at all.
Ps. Before trying out this color picker, i tried to use the Wordpress Iris (the default one included in every wp installation), by following this tutorial (http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/ ), to no avail.
I also installed a plugin that supposedly was a demo showing how to implement the default color picker ( https://github.com/rachelbaker/iris-color-picker-demo ). It didn't work either.
Any help would be immensely appreciated, i feel like i'm missing something but i can't understand what...