没有广告出现?我不知道为什么。
myAds.html
<template name="myAds">
<div class="ads"></div>
</template>
myAds.js
Template.myAds.onRendered = function() {
$.getScript("//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js", function() {
var ads, adsbygoogle;
ads = '<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-ca-pub-7023*********1" data-ad-slot="58*****42" data-ad-format="auto"></ins>';
$('.ads').html(ads);
return (adsbygoogle = window.adsbygoogle || []).push({});
});
};
router.js
Router.map( function () {
this.route('MyRoute', {
waitOn: function() {
return IRLibLoader.load("//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js");
}
});
});
ShowAdHere.html
{{ > myAds }}
答案 0 :(得分:1)
<head>
"<script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>"
</head>
你添加了吗?