Q:

SyntaxError: missing ; before statement - jQuery ContentHover

Getting the error on console, says something is wrong with this code..
$.fn.contenthover = function(method) {  
    if (methods[method]) {
        return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
    } else if (typeof method === 'object' || !method) {
        return methods.init.apply(this, arguments);
    } else {
        $.error('Method '+ method +' does not exist in contentHover plugin.');
    }
});

And also this in HTML
<script>
$(document).ready(function(){
    $('#d1').contenthover({
        overlay_background:'#000',
        overlay_opacity:0.5
    });
});
</script>

Could someone tell me where I went wrong with both? Thanks! - stilllearning

A:

The issue to me looks like a trailing parentheses at the end. Try this:
$.fn.contenthover = function(method) {  
    if (methods[method]) {
        return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
    } else if (typeof method === 'object' || !method) {
        return methods.init.apply(this, arguments);
    } else {
        $.error('Method '+ method +' does not exist in contentHover plugin.');
    }
};

