Answer the question
In order to leave comments, you need to log in
Why doesn't the Adsense code pasted through jQuery work?
Hi dear experts!
I insert 2 ad blocks at the end of the file in this way, but the ad does not work:
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var ads = $("#adsense").html();
/* блок 1*/
$('.grid-barb .product-grid:nth-child(3)').after('<div class="product-layout product-grid add_grid"><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-000000" data-ad-slot="000000" data-ad-format="auto" data-full-width-responsive="true"></ins></div>')
/* блок 2 */
$('.grid-barb .product-grid:nth-child(15)').after('<div class="product-layout product-grid add_grid"><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-000000" data-ad-slot="000000" data-ad-format="auto" data-full-width-responsive="true"></ins></div>')
(adsbygoogle = window.adsbygoogle || []).push({});
});
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question