我有一个在calendar.js中初始化的日历插件
! function($) {
"use strict";
var CalendarApp = function() {
this.$calendar = $('#calendar'),
this.$calendarObj = null
};
CalendarApp.prototype.init = function() {
// Initialized calendar with a library function
// this.$calendarObj = this.$calendar.calendar();
}
}(window.jQuery),
$(window).on('load', function() {
$.CalendarApp.init()
});
在document.ready function()中的另一页上,我想调用Calendar的方法,但未定义。
$("document").ready(function(){
// changeDate() is a function defined in calendar plugin
// CalendarApp.$calendarObj.changeDate();
// Getting changeDate is not function
});