Created
August 30, 2011 15:35
-
-
Save aghecht/1181187 to your computer and use it in GitHub Desktop.
Sample jQuery organization using JavaScript objects
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
var BackButton = { | |
init: function() { | |
if (this.sampleFunction()) { | |
$('.backbutton').click(this.backButtonEvent); | |
} | |
}, | |
sampleFunction: function() { | |
return true; | |
}, | |
backButtonEvent: function() { | |
history.go(-1); | |
} | |
}; | |
$(document).ready(function() { | |
BackButton.init(); | |
AnotherObject.init(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment