/ Published in: JavaScript
If you're using Adsense on responsive design, this is the code that you can use and it's NOT against its TOS.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script type="text/javascript"> google_ad_client = "ca-publisher-id"; width = document.documentElement.clientWidth; google_ad_slot = "1234567890"; google_ad_width = 320; google_ad_height = 50; if (width > 500) { google_ad_slot = "3456789012"; google_ad_width = 468; google_ad_height = 60; } if (width > 800) { google_ad_slot = "2345678901"; google_ad_width = 728; google_ad_height = 90; } </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>