这段 google adsense 代码到底是做什么的?
嘿,我正在尝试进一步加深我对 javascript 的了解,想知道是否有人可以向我解释下面的脚本中到底发生了什么:
<– Begin Google Adsense code –>
<script type=”text/javascript”>
google_ad_client = “ad-client-code-goes-here”;
google_ad_slot = “ad-slot-code-goes-here”;
google_ad_width = 300;
google_ad_height = 250;
</script>
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
<– End Google Adsense code –>
最重要的是,为什么开头有 4 个“google_ ad_ ...”以及什么是他们的目的?
逐行解释会很棒:)
感谢您的帮助。 对此,我真的非常感激。
Hey, I am trying to further my knowledge of javascript and was wondering if anyone could explain to me what exactly is happening in the script below:
<– Begin Google Adsense code –>
<script type=”text/javascript”>
google_ad_client = “ad-client-code-goes-here”;
google_ad_slot = “ad-slot-code-goes-here”;
google_ad_width = 300;
google_ad_height = 250;
</script>
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
<– End Google Adsense code –>
Most importantly, why are there 4 'google_ ad_ ...' at the beginning and what is the purpose of them?
A line by line explanation would be awesome :)
Thanks for any help. I really appreciate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
google_ad... 是变量(将此代码与您的帐户相关联,设置广告的宽度/高度等)。 它们是为稍后加载的脚本 (show_ads.js) 设置的。
有关变量的完整列表,请参阅Adsense 中使用的 CyberNAC Javascript 变量 。
The google_ad... are variables (associate this code to your account, set width/height of ad, etc). They're being set for the script (show_ads.js) that will later be loaded.
For a full rundown of the variables, see CyberNAC Javascript Variables used in Adsense.