Skip to content

Instantly share code, notes, and snippets.

@davist11
Created April 29, 2013 19:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davist11/738c2dfb248427904d07 to your computer and use it in GitHub Desktop.
Save davist11/738c2dfb248427904d07 to your computer and use it in GitHub Desktop.
SITE.features = {
init: function() {
var features = $('body').data('features');
var featuresArray = [];
if(features) {
featuresArray = features.split(' ');
for(var x = 0, length = featuresArray.length; x < length; x++) {
var func = featuresArray[x];
if(this[func] && typeof this[func].init === 'function') {
this[func].init();
}
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment