Last active
March 10, 2016 07:58
-
-
Save 0v3rth3d4wn/931609c49db01aa5593c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
;(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