Skip to content

Instantly share code, notes, and snippets.

@mattbontrager
Created November 20, 2012 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattbontrager/4116900 to your computer and use it in GitHub Desktop.
Save mattbontrager/4116900 to your computer and use it in GitHub Desktop.
immediately throw an error on app initialization (if connectivity is required) to prevent further errors (other unloaded CDN libraries, etc.)
var App = {
init: function(online) {
var self = this;
if (!online) {
alert('not connected');
}
}
};
$(function() {
App.init(navigator.onLine);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment