Skip to content

Instantly share code, notes, and snippets.

@carsontang
Last active December 16, 2015 01:30
Show Gist options
  • Save carsontang/5356013 to your computer and use it in GitHub Desktop.
Save carsontang/5356013 to your computer and use it in GitHub Desktop.
JavaScript differences?
// Version A: Works
WO.workouts = {
init: function() {
WO.workouts.index.init();
}
};
WO.workouts.index = {
init: function() {
$('.calendar td').click(function(){
alert("TO-DO: You've clicked a calendar cell!");
});
}
};
// Version B: Doesn't work
WO.workouts.index = {
init: function() {
$('.calendar td').click(function(){
alert("TO-DO: You've clicked a calendar cell!");
});
}
};
WO.workouts = {
init: function() {
WO.workouts.index.init();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment