Difference between revisions of "Template:Ads recomended"

From Enduro.team
Jump to: navigation, search
m
m
 
(23 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', 'recomended');
+
  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 {
document.head.appendChild(js);
+
    var d1 = document.getElementById('adsrecomended');
setTimeout(function(){
+
    d1.insertAdjacentHTML('beforeend', '<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-9226951475373251" data-ad-slot="3159268773"></ins>');
(recomended = window.adsbygoogle || []).push({});
+
}
}, 1000);
+
</script>
}, 3000);
+
<div class="adsrecomended" id="adsrecomended">
 +
<script>
 +
    (adsbygoogle = window.adsbygoogle || []).push({});
 
</script>
 
</script>
 
</div>
 
</div>

Latest revision as of 15:40, 22 July 2021