Hi, I have a question on the communications between multiple js files.
for example, in my index.html file I included 3 js files
I've got a problem that in the calendar.js file, I couldn't call functions defined in order.js. For example, in the index.html, <img src="images/cal.gif" onClick='popupCalendar("yyy-mm-dd", "onDateChanged()");'>, where the popupCalendar() is defined in calendar.js and onDateChanged() is a notification, defined in order.js.
In the function closeCalendar(), defined in calendar.js, it'll give notification to order.js by calling the remembered CALLBACK in this way:
// callback is set as "onDateChanged()" in function call, popupCalendar().
Actually, the callback onDateChanged() has never been called. However, if I put the definition of onDateChanged() in calendar.js, it will be called by the function closeCalendar(), which is not what I want. For one thing, I don't want to mix these functions together, for the second, function onDateChanged() will call some other functions defined in order.js as well.
Does anyone have some ideas on how to help me solv this problem? Thanks in advace!