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=1", function (data) { |
||
initialize(data); |
initialize(data); |
||
}) |
}) |
||
| Zeile 88: | Zeile 88: | ||
console.log("Error! Could not load the JSON file."); |
console.log("Error! Could not load the JSON file."); |
||
}); |
}); |
||
var postData; |
var postData; |
||
function initialize(data) { |
function initialize(data) { |
||
| Zeile 94: | 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.media_attachments.[0].[url]; |
||
$(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); |
||
| Zeile 111: | Zeile 112: | ||
} |
} |
||
function createSlider() { |
function createSlider() { |
||
Version vom 1. November 2023, 15:37 Uhr
DragonballWiki News Widget.