「MediaWiki:Common.js」の版間の差分

提供:ファンタジー能力Wiki
ナビゲーションに移動 検索に移動
編集の要約なし
タグ: 手動差し戻し 差し戻し済み
編集の要約なし
タグ: 手動差し戻し
1行目: 1行目:
/* ここにあるすべてのJavaScriptは、すべてのページ読み込みですべての利用者に対して読み込まれます */
/* ここにあるすべてのJavaScriptは、すべてのページ読み込みですべての利用者に対して読み込まれます */
$(document).ready(function() {
$(document).ready(function() {
     var adHtml = '<div id="footer-ad" style="text-align: center; margin-top: 20px;">' +
     // フッターの存在を確認してから広告スクリプトを追加
                '<a href="https://your-ad-link.example.com" target="_blank">' +
    if ($('#footer').length) {
                '<img src="https://your-ad-image.example.com/banner.jpg" alt="広告" style="width:300px; height:auto;">' +
        $.getScript("https://adm.shinobi.jp/s/e5693d186bd4b5059686530409d0aec1")
                '</a></div>';
        .done(function() {
      
            console.log("Ad script loaded successfully.");
    $('#footer').append(adHtml);
        })
        .fail(function(jqxhr, settings, exception) {
            console.error("Failed to load ad script:", exception);
        });
     } else {
        console.error("Footer element not found.");
    }
});
});

2025年2月9日 (日) 17:37時点における版

/* ここにあるすべてのJavaScriptは、すべてのページ読み込みですべての利用者に対して読み込まれます */
$(document).ready(function() {
    // フッターの存在を確認してから広告スクリプトを追加
    if ($('#footer').length) {
        $.getScript("https://adm.shinobi.jp/s/e5693d186bd4b5059686530409d0aec1")
        .done(function() {
            console.log("Ad script loaded successfully.");
        })
        .fail(function(jqxhr, settings, exception) {
            console.error("Failed to load ad script:", exception);
        });
    } else {
        console.error("Footer element not found.");
    }
});