Heutige JSON-Schnittstelle im Verlauf, mit allen geteilt, die Daten stammen aus Wiki
$.getJSON('http://history.sturgeon.mopaas.com/jsonp?callback=?',function(data){
parserTodayObj(data);
});
function parserTodayObj(todayObj){
for(var key in todayObj){
if(/^.*birth.*$/.test(key)){
doBirthday(todayObj[key]);
}
if(/^.*Holiday.*$/.test(key)){
doHoliday(todayObj[key]);
}
if(/^.*Customs.* $/.test(key)){
doHoliday(todayObj[key]);
}
if(/^.*Death.*$/.test(key)){
doDeath( todayObj[key]);
}
if(/^.*事记.*$/.test(key)){
doMemorabilia(todayObj[key]);
}
}
}
parserTodayObj(todayObj);
Funktion doBirthday(Geburtstage){
if(birthdays.length != 0){
$(document.body).append("
" birthdayitem "
");Funktion doHoliday(holidays){
if(holidays.length != 0){
$(document.body).append("
" item "
");Funktion doDeath(deaths){
if(deaths.length != 0){
$(document.body).append("
" item "
");Funktion doMemorabilia(memorabilias){
if(memorabilias.length != 0){
$(document.body).append("
" item "
");$.getJSON('http://history.sturgeon.mopaas.com/jsonp?callback=?',function(data){
parserTodayObj(data);
});
function parserTodayObj(todayObj){
for(var key in todayObj){
if(/^.*birth.*$/.test(key)){
doBirthday(todayObj[key]);
}
if(/^.*Holiday.*$/.test(key)){
doHoliday(todayObj[key]);
}
if(/^.*Customs.* $/.test(key)){
doHoliday(todayObj[key]);
}
if(/^.*Death.*$/.test(key)){
doDeath( todayObj[key]);
}
if(/^.*事记.*$/.test(key)){
doMemorabilia(todayObj[key]);
}
}
}
parserTodayObj(todayObj);
Funktion doBirthday(Geburtstage){
if(birthdays.length != 0){
$(document.body).append("
" birthdayitem "
");Funktion doHoliday(holidays){
if(holidays.length != 0){
$(document.body).append("
" item "
");Funktion doDeath(deaths){
if(deaths.length != 0){
$(document.body).append("
" item "
");Funktion doMemorabilia(memorabilias){
if(memorabilias.length != 0){
$(document.body).append("
" item "
");