「MediaWiki:Common.js」の版間の差分
ナビゲーションに移動
検索に移動
1行目: | 1行目: | ||
− | (function( | + | (function(window, document) { |
− | + | var ad = document.createElement('script'); | |
− | var ad = | ||
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 = | + | var sc = document.getElementsByTagName('script')[0]; |
sc.parentNode.insertBefore(ad, sc); | sc.parentNode.insertBefore(ad, sc); | ||
console.log(ad); | console.log(ad); | ||
− | + | })(window, document); | |
− | })(document |
2020年12月18日 (金) 15:10時点における版
(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); console.log(ad); })(window, document);