Skip to content

Instantly share code, notes, and snippets.

@kozo002
Created November 20, 2011 14:31
Show Gist options
  • Select an option

  • Save kozo002/1380316 to your computer and use it in GitHub Desktop.

Select an option

Save kozo002/1380316 to your computer and use it in GitHub Desktop.
This is my coding method using jQuery javascript
(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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment