Difference between revisions of "Template:Ads recomended"

From Enduro.team
Jump to: navigation, search
m
m
 
(26 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
<html>
 
<html>
 
<body>
 
<body>
<div class="adsrecomended">
 
 
<script>
 
<script>
setTimeout(function(){
+
 
var div = document.createElement("ins");
+
if (window.matchMedia) {
div.setAttribute('class', 'adsbygoogle');
+
  if(window.matchMedia('(prefers-color-scheme: dark)').matches){
div.setAttribute('data-ad-client', '9226951475373251');
+
    var d1 = document.getElementById('adsrecomended');
div.setAttribute('data-ad-slot', '3159268773');
+
    d1.insertAdjacentHTML('beforeend', '<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-9226951475373251" data-ad-slot="3158273233"></ins>');
div.setAttribute('data-ad-format', 'autorelaxed');
+
  } else {
$('.search-results-title').append(div);
+
    var d1 = document.getElementById('adsrecomended');
var js = document.createElement("script");
+
    d1.insertAdjacentHTML('beforeend', '<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-9226951475373251" data-ad-slot="3159268773"></ins>');
js.setAttribute('src', 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9226951475373251');
+
  }
js.setAttribute('async', true);
+
} else {
js.setAttribute('crossorigin', anonymous);
+
    var d1 = document.getElementById('adsrecomended');
document.head.appendChild(js);
+
    d1.insertAdjacentHTML('beforeend', '<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-9226951475373251" data-ad-slot="3159268773"></ins>');
setTimeout(function(){
+
}
(adsbygoogle = window.adsbygoogle || []).push({});
+
</script>
}, 1000);
+
<div class="adsrecomended" id="adsrecomended">
}, 3000);
+
<script>
 +
    (adsbygoogle = window.adsbygoogle || []).push({});
 
</script>
 
</script>
 
</div>
 
</div>

Latest revision as of 15:40, 22 July 2021