MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
Created page with "Global AdSense script: if (mw.config.get('wgNamespaceNumber') >= 0) { var adsense = document.createElement('script'); adsense.async = true; adsense.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2210822700516836'; adsense.crossOrigin = 'anonymous'; document.head.appendChild(adsense); } $(document).ready(function() { // Add header ad var headerAd = ` <div id="header-ad" style="text-align:center;margin:10px auto;">..."
 
Blanked the page
Tag: Blanking
 
Line 1: Line 1:
/* Global AdSense script */
if (mw.config.get('wgNamespaceNumber') >= 0) {
  var adsense = document.createElement('script');
  adsense.async = true;
  adsense.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2210822700516836';
  adsense.crossOrigin = 'anonymous';
  document.head.appendChild(adsense);
}


$(document).ready(function() {
  // Add header ad
  var headerAd = `
  <div id="header-ad" style="text-align:center;margin:10px auto;">
    <ins class="adsbygoogle"
        style="display:block"
        data-ad-client="ca-pub-2210822700516836"
        data-ad-slot="1035233381"
        data-ad-format="auto"
        data-full-width-responsive="true"></ins>
  </div>`;
  $('#content').before(headerAd);
  (adsbygoogle = window.adsbygoogle || []).push({});
});