diff --git a/js/main.js b/js/main.js
index 7dfe6bf..d6032d7 100644
--- a/js/main.js
+++ b/js/main.js
@@ -4,10 +4,10 @@ $(document).ready( function() {
// get the list of switches to poll
var switchesJSON = $
.ajax( { url: 'switches.json', cache: false, dataType: 'json' } )
- .fail( function() {
- alert( 'Cannot find any switches' );
+ .fail( function( e, textStatus ) {
+ alert( 'Cannot find any switches: ' + textStatus );
})
- .always( function( data ) {
+ .done( function( data ) {
// create a section for each switch
$('#switches').html( '
' );
var menuCollapsed = ( data.switches.length > 1 ? 'true' : 'false' );
@@ -22,12 +22,13 @@ $(document).ready( function() {