Widget:DragonballWikiNews: Unterschied zwischen den Versionen
Aus DragonballWiki
Weitere Optionen
Inhalt gelöscht Inhalt hinzugefügt
| Zeile 82: | Zeile 82: | ||
// INITIALISATION |
// INITIALISATION |
||
defer(function () { |
defer(function () { |
||
$.getJSON("https:// |
$.getJSON("https://mastodon.social/api/v1/accounts/295223/statuses?exclude_replies&limit=10", function (data) { |
||
initialize(data); |
initialize(data); |
||
}) |
}) |
||
| Zeile 89: | Zeile 89: | ||
}); |
}); |
||
var postData; |
|||
function initialize(data) { |
function initialize(data) { |
||
| Zeile 95: | Zeile 95: | ||
$.each(postData, function (key, value) { |
$.each(postData, function (key, value) { |
||
var link = value. |
var link = value.url; |
||
$(".post" + key + "Link").attr('href', link); |
$(".post" + key + "Link").attr('href', link); |
||
var image = $('#post' + key + 'Image'); |
var image = $('#post' + key + 'Image'); |
||
var dataSrc = value. |
var dataSrc = value.account.avatar; |
||
$(image).attr('data-src', dataSrc); |
$(image).attr('data-src', dataSrc); |
||
var title = value. |
var title = value.application.name; |
||
var excerpt = value. |
var excerpt = value.content; |
||
$("#post" + key + "Title").html(title); |
$("#post" + key + "Title").html(title); |
||
Version vom 1. November 2023, 15:11 Uhr
DragonballWiki News Widget.