jQuery $.extend() not extending the object -


working on simple calendar script, trying make possible events posted proper day; jquery $.extend not extending options object. here snippet html file:

$("#cal").calendar({     month: 2,     events: [{         date: "2013-4-10",         workorder: 1234567890,         district: 01,         range: "2:00pm - 4:00pm",         appnotes: "this sample of notes... end",         installer: "john doe",         citynotes: "this sample of notes... end"     }, {         date: "2013-4-1",         workorder: 1234567890,         district: 01,         range: "3:00pm - 5:00pm",         appnotes: "this sample of notes... end",         installer: "john doe",         citynotes: "this sample of notes... end"     }] }); 

and beginning of plug in:

(function($){     $.fn.calendar = function(options){         var defaults= {             month: null,             prev: "prevmonth",             curr: "currmonth",             next: "nextmonth",             events: []         }, options = $.extend(defaults, options);         return($(this).each(function(){             var obj = $(this),             // etc... 

i'm able access properties of object, not being extended thought. ideas?

jquery.extend extends first object passed in - rather doing $.extend(defaults, options) $.extend({}, defaults, options).


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -