This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var elements, | |
bind = { | |
buttonClick: function() { | |
elements.$button.click(e) { e.preventDefault(); | |
action.sayHello('World'); | |
} | |
} | |
}, | |
action = { | |
sayHello: function(to) { | |
console.log('Hello ' + to + ' !') | |
} | |
}; | |
$(function() { | |
elements = { | |
$button: $('a.button') | |
}; | |
bind.buttonClick(); | |
}); | |
})(jQuery); |
こんな感じに落ち着いてる。
CoffeeScript覚えるのめんどくさい。
0 コメント:
コメントを投稿