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

提供: 韓食ペディア
ナビゲーションに移動 検索に移動
 
(同じ利用者による、間の2版が非表示)
1行目: 1行目:
(function(doc, win) {
+
(function(window, document) {
     win.addEventListener('load', function() {
+
     var ad = document.createElement('script');
        var ad = doc.createElement('script');
+
    ad.type = 'text/javascript';
        ad.type = 'text/javascript';
+
    ad.dataset.adClient = 'ca-pub-6884347898813638';
        ad.dataset.adClient = 'ca-pub-6884347898813638';
+
    ad.async = true;
        ad.async = true;
+
    ad.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
        ad.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
+
    var sc = document.getElementsByTagName('script')[0];
        var sc = doc.getElementsByTagName('script')[0];
+
    sc.parentNode.insertBefore(ad, sc);
        sc.parentNode.insertBefore(ad, sc);
+
})(window, document);
        console.log(ad);
 
    });
 
})(document, window);
 

2020年12月18日 (金) 15:15時点における最新版

(function(window, document) {
    var ad = document.createElement('script');
    ad.type = 'text/javascript';
    ad.dataset.adClient = 'ca-pub-6884347898813638';
    ad.async = true;
    ad.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
    var sc = document.getElementsByTagName('script')[0];
    sc.parentNode.insertBefore(ad, sc);
})(window, document);