views:

319

answers:

1

I am trying to attach a JQuery color picker plug-in to a textbox. The same code works in IE 6 & 7 but does not in FireFox. I see no errors or warnings of any sort it feels as if the plugin code is just being ignored.

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

    <script type="text/jscript">
    jQuery(function() {
        $('#TextColor').ColorPicker({
            onSubmit: function(hsb, hex, rgb, el) {
                $(el).val(hex);
                $(el).ColorPickerHide();
                //sets bg color of prev div
                $('#' + el.id + 'Prev').css('backgroundColor', '#' + hex);
            },
            onShow: function(colpkr) {
                $(colpkr).fadeIn(500);
                return false;
            },
            onHide: function(colpkr) {
                $(colpkr).fadeOut(500);
                return false;
            },
            onBeforeShow: function() {
                $(this).ColorPickerSetColor(this.value);
            }
        })
    .bind('keyup', function() {
        $(this).ColorPickerSetColor(this.value);
    });
    });
</script>

The current scripts are placed at the bottom of the page but I have tried loading the plug-in code at the top and the setup code at the bottom. All suggestions are welcome.

+3  A: 

try <script type="text/javascript">..</script>

The first time you use it, but the second time you use text/jscript

Ikke
wow you nailed it, I cant believe I missed that I have been staring at this chunk of code for hours. IE ignored the typo where firefox ignored my code. THANK YOU.
Aaron