Skip to content

Instantly share code, notes, and snippets.

@0v3rth3d4wn
Last active March 10, 2016 07:58
Show Gist options
  • Save 0v3rth3d4wn/931609c49db01aa5593c to your computer and use it in GitHub Desktop.
Save 0v3rth3d4wn/931609c49db01aa5593c to your computer and use it in GitHub Desktop.
;(function ( $, window, document, undefined ) {
//url to settings json file
var settingsJSON = '',
settings = {};
$(document).on('click', '.selector', function(event) {
event.preventDefault();
/* Act on the event */
$.getJSON( settingsJSON, function( data ) {
settings = data;
} )
.success( function() {
console.debug( 'Settings loaded!' );
// Do stuff with settings
})
.fail( function() {
console.warn( 'Failed to load settings.' );
} );
});
})( jQuery, window, document );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment