-->

Sửa Lỗi Không Lưu Được Mã Quảng Cáo Adsense Trong Blogger

Việc chèn quảng cáo vào đầu và cuối bài viết thì không dễ như chèn vào cột bên phải, bạn cần phải vào Mẫu > Chỉnh sủa HTML để làm việc này. Và bạn sẽ thường xuyên gặp lỗi như thế này:

Attribute name "async" associated with an element type "script" must be followed by the ' = ' character
Để sửa lỗi trên bạn chỉ cần thêm dòng như sau vào code: 
   async="async"
Ví dụ cụ thể, code Google Adsense đang như thế này: 

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MLTC foot post 336v280 -->
<ins class="adsbygoogle" data-ad-client="ca-pub-712987019925812345" data-ad-slot="6386538945" style="display: inline-block; height: 280px; width: 336px;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Bạn phải sửa lại thành như thế này thì khi chèn vào mới không bị lỗi:

<script async="async"src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MLTC foot post 336v280 -->
<ins class="adsbygoogle" data-ad-client="ca-pub-712987019925812345" data-ad-slot="6386538945" style="display: inline-block; height: 280px; width: 336px;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});

</script> 

Chúc Các Bạn Sửa Thành Công !
NGUỒN: SHOP THỦ THUẬT!

Viết bình luận (0)
Xếp theo