I have a jQuery plugin tzineClock. But when I try to call it
$(document).ready(function(){
/* This code is executed after the DOM has been completely loaded */
$('#fancyClock').tzineClock();
});
it is throwing error as “this function is not supported”. Can any one tell me what the error could be? Here is the tzineClock code:
$.fn.tzineClock = function(opts){
// "this" contains the elements that were selected when calling the plugin: $('elements').tzineClock();
// If the selector returned more than one element, use the first one:
var container = this.eq(0);
if(!container)
{
try{
console.log("Invalid selector!");
} catch(e){}
return false;
}
if(!opts) opts = {};
var defaults = {
/* Additional options will be added in future versions of the plugin. */
};
/* Merging the provided options with the default ones (will be used in future versions of the plugin): */
$.each(defaults,function(k,v){
opts[k] = opts[k] || defaults[k];
})
// Calling the setUp function and passing the container,
// will be available to the setUp function as "this":
setUp.call(container);
return this;
}
This is likely because jQuery has yet to load the tzineClock function and hence it is “not supported”.
Check your script tags where you’re referencing the plugin and ensure that the tzineClock script tag appears before the jQuery one.
If this makes no difference can you give us the line and file which is causing the error and ensure the script file has actually loaded using any of the browser developer tools.