程式内容 与股票相关
有两个栏位
下面两个按钮 为发送以及 清除
希望能在 栏位为空字串时 下方按钮 不可以使用 (DISABLE)
栏位 有选择日期时 则 ENABLE 按钮可使用
下面为CODE 感觉合理 但不知为何跑不出来 希望有大大 可以帮解答 谢谢
问题出在 红色字那边@@
var mediator = ( function() {
// Storage for our topics/events
var channels = {};
// Subscribe to an event, supply a callback to be executed
// when that event is broadcast
var subscribe = function(channel, fn) {
if (!channels)
channels = [];
channels.push({
context : this,
callback : fn
});
return this;
};
// Publish/broadcast an event to the rest of the application
var publish = function(channel) {
if (!channels)
return false;
var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0, l = channels.length; i < l; i++) {
var subscription = channels;
subscription.callback.apply(subscription.context, args);
}
return this;
};
return {
publish : publish,
subscribe : subscribe,
installTo : function(obj) {
obj.subscribe = subscribe;
obj.publish = publish;
}
};
}());
var ..
访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容