La interfaz JSON de hoy en la historia, la compartiré con usted.
La copia del código es la siguiente:
//http://history.sturgeon.mopaas.com // Página de inicio
//http://history.sturgeon.mopaas.com/jsonp?callback=?
//http://history.sturgeon.mopaas.com/jsonp // interfaz json
//http://history.sturgeon.mopaas.com/jsonp/1@1 // 1 de enero en historia
//http://history.sturgeon.mopaas.com/1@1 // 1 de enero en historia
$ .getjson ('http://history.sturgeon.mopaas.com/jsonp?callback=?', Function (data) {
parserTodayobj (datos);
});
función parserTodayobj (Todayobj) {
para (varilla var en thayobj) {
if (/^.* Born.*$/. Test (Key)) {
Dobirthday (TodayObj [clave]);
}
if (/^.* Holiday.*$/. Test (Key)) {
DOHOLIDAY (TodayObj [clave]);
}
if (/^.* Custom.*$/. Test (Key)) {
DOHOLIDAY (TodayObj [clave]);
}
if (/^.* Death.*$/. Test (Key)) {
Dodath (TodayObj [Key]);
}
if (/^.* eventos.* $/. test (key)) {
Domemorabiliia (Todayobj [clave]);
}
}
}
parserTodayobj (Todayobj);
función Dobirthday (cumpleaños) {
if (birthdays.length! = 0) {
$ (document.body) .append ("<h3> nacido </h3>");
para (var i = 0; i <birthdays.length; i ++) {
VAR CUMPLEAÑOITEM = CUMPLEABLES [i];
$ (document.body) .Append ("<P>"+BirthrenoItem+"</p>");
};
}
}
función doholiday (vacaciones) {
if (vacaciones.length! = 0) {
$ (document.body) .append ("<h3> festival </h3>");
para (var i = 0; i <holidays.length; i ++) {
VAR Artículo = vacaciones [i];
$ (document.body) .append ("<p>"+item+"</p>");
};
}
}
función dodeath (muertes) {
if (Deaths.length! = 0) {
$ (document.body) .append ("<h3> Death </h3>");
para (var i = 0; i <falls.length; i ++) {
var item = Deaths [i];
$ (document.body) .append ("<p>"+item+"</p>");
};
}
}
función domemorabiliia (recuerdos) {
if (memorabilias.length! = 0) {
$ (document.body) .append ("<h3> mayor evento </h3>");
para (var i = 0; i <memorabilias.length; i ++) {
var item = Memorabilias [i];
$ (document.body) .append ("<p>"+item+"</p>");
};
}
}
La copia del código es la siguiente:
//http://history.sturgeon.mopaas.com // Página de inicio
//http://history.sturgeon.mopaas.com/jsonp?callback=?
//http://history.sturgeon.mopaas.com/jsonp // interfaz json
//http://history.sturgeon.mopaas.com/jsonp/1@1 // 1 de enero en historia
//http://history.sturgeon.mopaas.com/1@1 // 1 de enero en historia
$ .getjson ('http://history.sturgeon.mopaas.com/jsonp?callback=?', Function (data) {
parserTodayobj (datos);
});
función parserTodayobj (Todayobj) {
para (varilla var en hoyObj) {
if (/^.* nace.*$/. test (key)) {
Dobirthday (TodayObj [clave]);
}
if (/^.* Holiday.*$/. Test (Key)) {
DOHOLIDAY (TodayObj [clave]);
}
if (/^.* Custom.*$/. Test (Key)) {
DOHOLIDAY (TodayObj [clave]);
}
if (/^.* Death.*$/. Test (Key)) {
Dodath (TodayObj [Key]);
}
if (/^.* eventos.* $/. test (key)) {
Domemorabiliia (Todayobj [clave]);
}
}
}
parserTodayobj (Todayobj);
función Dobirthday (cumpleaños) {
if (birthdays.length! = 0) {
$ (document.body) .append ("<h3> nacido </h3>");
para (var i = 0; i <birthdays.length; i ++) {
VAR CUMPLEAÑOITEM = CUMPLEABLES [i];
$ (document.body) .Append ("<P>"+BirthrenoItem+"</p>");
};
}
}
función doholiday (vacaciones) {
if (vacaciones.length! = 0) {
$ (document.body) .append ("<h3> festival </h3>");
para (var i = 0; i <holidays.length; i ++) {
VAR Artículo = vacaciones [i];
$ (document.body) .append ("<p>"+item+"</p>");
};
}
}
función dodeath (muertes) {
if (Deaths.length! = 0) {
$ (document.body) .append ("<h3> Death </h3>");
para (var i = 0; i <falls.length; i ++) {
var item = Deaths [i];
$ (document.body) .append ("<p>"+item+"</p>");
};
}
}
función domemorabiliia (recuerdos) {
if (memorabilias.length! = 0) {
$ (document.body) .append ("<h3> mayor evento </h3>");
para (var i = 0; i <memorabilias.length; i ++) {
var item = Memorabilias [i];
$ (document.body) .append ("<p>"+item+"</p>");
};
}
}