anyone know how to pass the defaults value to the element. this is in Jquery boilerplate. like for example the propertyname should be "this is a test" now. TIA
;(function ( $, window, undefined ) {
var pluginName = 'defaultPluginName',
document = window.document,
defaults = {
propertyName: "value"
};
function Plugin( element, options ) {
this.element = element;
this.options = $.extend( {}, defaults, options) ;
_option = option;
this._defaults = defaults;
this._name = pluginName;
this.init();
}
Plugin.prototype.init = function () {
$("#test").text(_option.propertyName);
// code goes here
};//init
$.fn[pluginName] = function ( options ) {
return this.each(function () {
if (!$.data(this, 'plugin_' + pluginName)) {
$.data(this, 'plugin_' + pluginName, new Plugin( this, options ));
}
});
};
}(jQuery, window));
$('#test').defaultPluginName({propertyName: "this is a test"});