-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Farthen
committed
Nov 3, 2013
1 parent
1dc3a1c
commit cc44fc1
Showing
2 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
$.ajax('http://api.wurstmineberg.de/server/level.json', { | ||
dataType: 'json', | ||
success: | ||
success: function(data) { | ||
var rainstatus = -1 | ||
if ('Data' in data) { | ||
if ('raining' in data['Data']) { | ||
rainstatus = data['Data']['raining'] | ||
} | ||
} | ||
|
||
|
||
}); | ||
if (rainstatus == -1) { | ||
$('#rain-caption').text("???") | ||
$('#rain-text').text("I have no idea. Seriously. Something is broken") | ||
} else if (rainstatus == 0) { | ||
$('#rain-caption').text("No!") | ||
$('#rain-text').text("It's not raining.") | ||
} else { | ||
$('#rain-caption').text("Yes!") | ||
$('#rain-text').text("It's raining!") | ||
} | ||
} | ||
}); |