Hacker Newsnew | comments | show | ask | jobs | submit login

If you want to roll your own UI (something less obtrusive, perhaps), this can be done in only a few lines of code. From our Backbone.js app...

    (function() {
        var errorView = null;
        $(window).on('online', function() {
            if (errorView) errorView.close();
            errorView = null;
        });
        $(window).on('offline', function() {
            errorView = new ErrorView({ message: 'No internet connection.'});
            errorView.render();
        });
    }());



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: