Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. var loadAdsense = function (parentId, client, slot, insclass, width, height) {
  2. try {
  3. var id = document.getElementById(parentId);
  4. if (!id) {
  5. return;
  6. }
  7. loadScript("//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js", function () {
  8. var a = document.createElement("ins");
  9. a.setAttribute("class", insclass);
  10. a.setAttribute("style", "display:inline-block;width:" + width + "px;height:" + height + "px");
  11. a.setAttribute("data-ad-client", client);
  12. a.setAttribute("data-ad-slot", slot);
  13. id.appendChild(a);
  14. (adsbygoogle = window.adsbygoogle || []).push({});
  15. }, null, true);
  16. } catch (e) {
  17. console.log(e.message);
  18. }
  19. };
  20.  
  21. loadAdsense("body", "ca-pub-5139218182323575", "6266130042", "adsbygoogle", 300, 250);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement